kwangu

EXCEL VBA-COPY TEXT FROM COLUMN A TO B

Jul 10th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub CommandButton1_Click()
  2.  
  3.  Dim recSheet As Worksheet
  4.  Set recSheet = ThisWorkbook.Sheets("original")
  5.  
  6. 'loop through column A and find words
  7. 'which starts with "Acc" if next cell is not starting with "Acc"
  8.  
  9.  'LastRow = recSheet.Cells(Rows.Count, "A").End(xlUp).Row
  10. 'NextRow = recSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1
  11.  
  12.  'For i = 2 To LastRow
  13.  
  14.     'If Range("A" & i).Value = "Acc*" And NextRow <> "Acc*" Then
  15.    ' Range("A" & i).Select
  16.     'Selection.Cut
  17.  
  18.      'Range("B" & i").Select
  19.     'ActiveSheet.Paste
  20.  
  21.    'End If
  22. 'Next i
  23. End Sub
Add Comment
Please, Sign In to add comment