Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 9
Default Please help! with find/copy/replace

I have tweaked a macro to do all kinds of new things thanks to searching for answers on this forum. My current issue is that it is skipping a cell. It skips the first '90601' and doesn't copy it. Thanks in advance for any help and advice!!

Dim LSearchRow As Integer
LSearchRow = 1


While Len(Range("A" & CStr(LSearchRow)).Value) 0

'If Column D = "90601", copy entire row
If Range("D" & CStr(LSearchRow)).Value = "90601" Then
Range("D" & CStr(LSearchRow)).EntireRow.Copy
'Insert copied Row below the original
Range("D" & CStr(LSearchRow)).EntireRow.Insert Shift:=xlDown
'Change values in Columns D on new row to 20150
Range("D" & CStr(LSearchRow + 1)) = "20150"
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Please help! with find/copy/replace

Your code misses the first value "90601" because on the same row of the missing value, column A is empty or len...= 0
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
use copy paste function in the find & replace box Shkendi Excel Discussion (Misc queries) 2 January 7th 10 09:53 PM
Copy contents of Find (Find and Replace) rob_bob Excel Discussion (Misc queries) 0 March 26th 09 11:01 PM
find and replace help with copy paste Alex43 Excel Discussion (Misc queries) 1 March 17th 08 11:13 PM
How can i copy the values derived from find and replace? clem Excel Discussion (Misc queries) 2 March 10th 08 02:55 AM
Find/Replace Event or Find/Replace for Protected Sheet ... Joe HM Excel Programming 2 October 27th 07 03:55 PM


All times are GMT +1. The time now is 03:36 PM.

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"