G
Guest
Hi, wonder if someone can help please.
I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.
Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.
Can someone help please.
Kind regards
Chris
Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range
Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl
End Sub
I have a great bit of coding below from Norman Jones which deletes contents
of cells and copies and pastes the data from above rows. I've tried to get
hold of him again to see if he could help in tweaking this code perhaps he's
had enough of my questions, don't blame him.
Anyway, rather than the code looking at the whole page I need a specific
range. Norman gave me this amendment 'Set myRange =
Activesheet.Range("A2:A10")', but unfortuantely this selects the range
specifically looking at rows. I basically need the coding to pick the range
columns A to I only, but for it to continue looking down the page copying the
data as in the original coding.
Can someone help please.
Kind regards
Chris
Public Sub FindCopy()
Dim cl As Range
Dim myRange As Range
Set myRange = ActiveSheet.Range("A2:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)
For Each cl In myRange
With cl
If Len(Trim(.Value)) = 0 Then
.Offset(-1, 0).EntireRow.Copy _
Destination:=.Item(1)
End If
End With
Next cl
End Sub