title: Excel VBA- Copy and paste text on left after CHAR(10)
body: <p>If the following conditions:</p>
  
  <p>A1=
  fsfsdfsdfs</p>
  
  <p>qewqeqewqe   </p>
  
  <p>B1=
  RIGHT(A1,FIND(CHAR(10),A1&amp;" ")) </p>
  
  <p>Then B1 would display "qewqeqewqe".</p>
  
  <p>This works only directly into an excel cell. How would I write this line of code given the following conditions above?</p>
  
  <p>Something like the below?</p>
  
  <pre><code>Worksheets("sheet1").Cells(1,2).value= left(find(CHR(10), Worksheets("sheet1").Cells(1,1),&amp;""))?????
  </code></pre>
  
  <p>I would not be asking if I had not searched for it. All I keep finding is how to do it in an excel file and not the VBA. Any help would be greatly appreciated. Thanks!  </p>
  
  <pre><code>Sub test()
  
  Dim txt As String
  Dim fullname As String
  
  txt = Worksheets("Sheet1").Cells(1, 1).Value
  fullname = Split(txt, Chr(10))
  
  Worksheets("Sheet1").Cells(1, 2).Value = fullname
  
  End Sub
  </code></pre>