Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Next row
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Next row
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 "Steved" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Next row
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 "Mike" wrote: 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 "Steved" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Next row
Hello from Steved
Please ignore Thankyou. "Steved" wrote: 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 "Mike" wrote: 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 "Steved" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and Replace - delete the remainder of the text in the cell after my Find | Excel Programming | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
find and delete duplicate entries in two columns or find and prin. | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |