LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro Problem

Didn't have time to test any of this as you need to clarify your request.
Sub Macro2()
'Application.ScreenUpdating = False
Range("F3:F52").Copy Range("H3")
Columns("H:H").Insert Shift:=xlToRight
Range("F3:F52").ClearContents

'what about this line for each sheet
Sheets("Sheet1").Range("A2:C26").ClearContents
application.goto Sheets("Sheet2").Range("F3")

' Application.ScreenUpdating = True
End Sub
for all ws

Sub Macro2()
for each ws in worksheets
with ws
.Range("F3:F52").Copy .Range("H3")
.Columns("H:H").Insert Shift:=xlToRight
.Range("F3:F52").ClearContents

'what about this line for each sheet
Sheets("Sheet1").Range("A2:C26").ClearContents
application.goto Sheets("Sheet2").Range("F3")

end with
next ws
End Sub


--
Don Guillett
SalesAid Software

"Hazel" wrote in message
...
Hi All you experts out there,

I have a little macro code below which runs on Sheet1 of my workbook -- as
I
have 26 sheets in the workbook when I run the macro - Ineed it to run on
every sheet not just on Sheet 1 -- how would I alter the macro. When you
read
the code you will probably come up with something much better and easier.

Sub Macro2()
Application.ScreenUpdating = False
Range("F3:F52").Select
Selection.Copy
Range("H3").Select
ActiveSheet.Paste
Columns("H:H").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Range("F3:F52").Select
Selection.ClearContents
Sheets("Sheet1").Select
Range("A2:C26").Select
Selection.ClearContents
Sheets("Sheet2").Select
Range("F3").Select
Application.ScreenUpdating = True
End Sub

--
Many thanks

hazel



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Color Row Macro Problem, adapted from Patrick Malloy macro SteveC Excel Programming 4 June 21st 06 12:28 PM
Problem in updating all worksheets of a workbook using a macro that calls another macro [email protected] Excel Programming 3 March 20th 06 05:21 AM
macro problem Kevin Excel Discussion (Misc queries) 1 December 14th 04 10:47 PM


All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"