![]() |
| 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. |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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 | |
|
|
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 |