Andreamary
asked on
Change VBA code so partial row to be copied to another sheet if cell not blank
Attached is a sample of the current VBA code I am using, which copies over a partial row to another sheet if a cell = "Yes". I would like to change the code so that the partial row will be copied over to another sheet if the cell is not blank.
Thanks!
Andrea
CopyPartialRow-Example.xlsm
Thanks!
Andrea
CopyPartialRow-Example.xlsm
Andrea,
If your vba is actually working, you have to change the Line 3 of the following code
If your vba is actually working, you have to change the Line 3 of the following code
Sub InitCopyRow()
For I = 1 To Sheet1.UsedRange.Rows.Count
If Sheet1.Cells(I, 24) = "Yes" Then
CopyRow (I)
End If
Next
End Sub
From:
If Sheet1.Cells(I,24) = "Yes" Then
To:
If Sheet1.Cells(I,24) <> "" Then
ASKER
Hi Harry,
That's odd, as it works on my system. On Worksheet 1, with 4 lines of sample text, if I enter "Yes" in Column X, a partial row is copied to Worksheet 2. Removing and re-entering "Yes" again in Column X will trigger the row to copy over a second time.
Andrea
That's odd, as it works on my system. On Worksheet 1, with 4 lines of sample text, if I enter "Yes" in Column X, a partial row is copied to Worksheet 2. Removing and re-entering "Yes" again in Column X will trigger the row to copy over a second time.
Andrea
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Harry, works perfectly!
And thanks to you both, since this helped me with a similar problem!
You vba macro is not even functional. How can you be using it at the moment? Are you sure you have included the full macro with your sample?