Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - delete the remainder of the text in the cell after my Find [email protected] Excel Programming 4 August 4th 07 03:39 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"