Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem running macro across worksheets within workbook
I have a 100 worksheet document and need to extract some of the data for an eventual access database. I recorded the macro below to work on a single worksheet, but how can I loop it through all the worksheets? If I run it manually, it just pastes over previous data. Sub SingleSheet() ' ' SingleSheet Macro ' Macro recorded 3/30/2006 by ' ' Range("C2").Select Selection.Copy Columns("A:A").Select Application.CutCopyMode = False Selection.Insert Shift:=xlToRight Range("D2").Select Selection.Copy Range("A1").Select ActiveSheet.Paste Application.CutCopyMode = False Selection.AutoFill Destination:=Range("A1:A153"), Type:=xlFillDefault Range("A1:A153").Select Range("J9:V153,A9:C153,I9:I153").Select Range("I153").Activate Selection.Copy Windows("Orange.xls").Activate Range("A1").Select ActiveSheet.Paste Windows("template.xls").Activate End Sub -- weene27 ------------------------------------------------------------------------ weene27's Profile: http://www.excelforum.com/member.php...o&userid=32996 View this thread: http://www.excelforum.com/showthread...hreadid=528199 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running Same macro in 250 Worksheets in Same Workbook | Excel Worksheet Functions | |||
Problem in updating all worksheets of a workbook using a macro that calls another macro | Excel Programming | |||
Running a macro for all visible worksheets in a workbook | Excel Discussion (Misc queries) | |||
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? | Excel Programming | |||
Problem running macro from add-in (xla-file) in a shared workbook. | Excel Programming |