Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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:p150").Select Range("A99").Select If IsEmpty(ActiveCell) Then Range("A69").Select Else: Range("A1:P120").Select Range("A69").Select If IsEmpty(ActiveCell) Then Range("A39").Select Else: Range("A1:P90").Select Range("A39").Select If IsEmpty(ActiveCell) Then Range("A9").Select Else: Range("A1:P60").Select Range("A9").Select If Range("A9") < "" Then Range("A1:P30").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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Number of pages in worksheet doesn't match Print Preview pages | Excel Discussion (Misc queries) | |||
Copy headers and footers to other pages? | Excel Worksheet Functions | |||
Copy the same cell from numerouse pages | New Users to Excel | |||
Copy a formula to 15 pages | New Users to Excel | |||
Auto Choosing Pages to Copy | Excel Programming |