Find Next row

S

Steved

Hello from Steved

I have a worksheet that gets new information Daily

The below works fine except when I bring in new Data and run the macro it
finds the next row which has a Surname in Col I and first name in Col J for
example it may be row 100 the macro will Combine Col I and Col J into Col I
which is What it is required to do, then it deletes everything above it
please what is reqired to stop the deleting Thankyou.

Sub Trythis()
Dim lastcell As Long
Dim i As Long
lastcell = Cells(Rows.Count, "I").End(xlUp).Row
For i = 1 To lastcell
'combine Column I and J
Range("I" & i).Value = Range("I" & i).Value & " " & _
Range("I" & i).Offset(0, 1).Value
'clear column B value
Range("I" & i).Offset(0, 1).Value = ""
Next
End Sub
 
M

Mike

Sub Trythis()
Dim lastcell As Long
Dim i As Long
lastcell = Cells(Rows.Count, "I").End(xlUp).Row
For i = 1 To lastcell
'combine Column I and J
Range("I" & i).Value = Range("I" & i).Value & " " & _
Range("I" & i).Offset(0, 1).Value
'clear column B value
'Range("I" & i).Offset(0, 1).Value = ""
Next
End Sub
 
S

Steved

Hello from Steved

Mike using Your Macro please how can I tell it to remove the Data in Column
J as it is no longer required

Thankyou

Sub Trythis()
Dim lastcell As Long
Dim i As Long
lastcell = Cells(Rows.Count, "I").End(xlUp).Row
For i = 1 To lastcell
'combine Column I and J
Range("I" & i).Value = Range("I" & i).Value & " " & _
Range("I" & i).Offset(0, 1).Value
'clear column J value
'Range("I" & i).Offset(0, 1).Value = ""
Next
End Sub
 
S

Steved

Hello from Steved

Please ignore

Thankyou.

Steved said:
Hello from Steved

Mike using Your Macro please how can I tell it to remove the Data in Column
J as it is no longer required

Thankyou

Sub Trythis()
Dim lastcell As Long
Dim i As Long
lastcell = Cells(Rows.Count, "I").End(xlUp).Row
For i = 1 To lastcell
'combine Column I and J
Range("I" & i).Value = Range("I" & i).Value & " " & _
Range("I" & i).Offset(0, 1).Value
'clear column J value
'Range("I" & i).Offset(0, 1).Value = ""
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top