A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Please help! with find/copy/replace



 
 
Thread Tools Display Modes
  #1  
Old July 19th 12, 09:49 PM
ksquirt ksquirt is offline
Junior Member
 
First recorded activity by ExcelBanter: Jul 2012
Posts: 6
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
Ads
  #2  
Old July 24th 12, 11:35 PM posted to microsoft.public.excel.programming
pascal baro
external usenet poster
 
Posts: 19
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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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 02:28 AM.


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