S
Sam Fowler
Hi :
Can anyone help me with this. I am trying to get a macro
to look at a worksheet and determine which of the 10
pages in the worksheet have data. (All pages are sized
exactly the same and contain data in the same cells (If
Data is present, it will first reside in a9 - Page1, A39 -
Page2, etc...)I would then like to copy the page(S) that
do contain data to the next empty cell in a different
worksheet. (formatting as well). Then go back to the
worksheet that was copied and clear the data. After that
I want it to go to the next worksheet and perform the
same processes.
The code below is where I am and being somewhat of a
novice, with VBA, I have used the macro recorder for most
of the code.
Sub CopyDOCS1()
Sheets("Used Cores").Select
Range("A129").Select
If IsEmpty(ActiveCell) Then
Range("A99").Select
Else: Range("a1
150").Select
Range("A99").Select
If IsEmpty(ActiveCell) Then
Range("A69").Select
Else: Range("A1
120").Select
Range("A69").Select
If IsEmpty(ActiveCell) Then
Range("A39").Select
Else: Range("A1
90").Select
Range("A39").Select
If IsEmpty(ActiveCell) Then
Range("A9").Select
Else: Range("A1
60").Select
Range("A9").Select
If Range("A9") <> "" Then
Range("A1
30").Select
Else: Exit Sub
End If
End If
End If
End If
End If
Selection.Copy
Sheets("INV").Select
Dim cell As Range
Set cell = Cells(65536, 1).End(xlUp)
Set cell = cell.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Used Cores").Select
Range("A9:L28").Select
Selection.ClearContents
End Sub
Any help would be appreciated
Sam
Can anyone help me with this. I am trying to get a macro
to look at a worksheet and determine which of the 10
pages in the worksheet have data. (All pages are sized
exactly the same and contain data in the same cells (If
Data is present, it will first reside in a9 - Page1, A39 -
Page2, etc...)I would then like to copy the page(S) that
do contain data to the next empty cell in a different
worksheet. (formatting as well). Then go back to the
worksheet that was copied and clear the data. After that
I want it to go to the next worksheet and perform the
same processes.
The code below is where I am and being somewhat of a
novice, with VBA, I have used the macro recorder for most
of the code.
Sub CopyDOCS1()
Sheets("Used Cores").Select
Range("A129").Select
If IsEmpty(ActiveCell) Then
Range("A99").Select
Else: Range("a1
Range("A99").Select
If IsEmpty(ActiveCell) Then
Range("A69").Select
Else: Range("A1
Range("A69").Select
If IsEmpty(ActiveCell) Then
Range("A39").Select
Else: Range("A1
Range("A39").Select
If IsEmpty(ActiveCell) Then
Range("A9").Select
Else: Range("A1
Range("A9").Select
If Range("A9") <> "" Then
Range("A1
Else: Exit Sub
End If
End If
End If
End If
End If
Selection.Copy
Sheets("INV").Select
Dim cell As Range
Set cell = Cells(65536, 1).End(xlUp)
Set cell = cell.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Used Cores").Select
Range("A9:L28").Select
Selection.ClearContents
End Sub
Any help would be appreciated
Sam