View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
weene27 weene27 is offline
external usenet poster
 
Posts: 1
Default 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