Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro to Perform Same Function Across Selected Sheets

Hi all,

I'm new to VBA and could use some help. I'm trying to have a macro
perform the same function (paste a rectangle) across several selected
sheets (say, 1-4,7,9,10 of 10). I can get the macro to paste the
rectangle across ALL the sheets, but I only want it on those selected.
Any ideas?

Thanks in advance,
Stephan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro to Perform Same Function Across Selected Sheets

Here's the code I currently have:

Sub CoverStopwatch()
'
' CoverStopwatch Macro
'
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.Select
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 3.75, 39.75, 79.5,
37.5). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 4.5, 540#, 82.5,
21.75). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
Range("Q1:V1").Select
Next sh
End Sub


Thanks.



Don Guillett wrote:
As always, post your coding efforts for comments and suggestions.

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Hi all,

I'm new to VBA and could use some help. I'm trying to have a macro
perform the same function (paste a rectangle) across several selected
sheets (say, 1-4,7,9,10 of 10). I can get the macro to paste the
rectangle across ALL the sheets, but I only want it on those selected.
Any ideas?

Thanks in advance,
Stephan


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro to Perform Same Function Across Selected Sheets

Sub ss()
For Each ws In ActiveWindow.SelectedSheets
MsgBox ws.Name
Next ws
End Sub


--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Here's the code I currently have:

Sub CoverStopwatch()
'
' CoverStopwatch Macro
'
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.Select
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 3.75, 39.75, 79.5,
37.5). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 4.5, 540#, 82.5,
21.75). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
Range("Q1:V1").Select
Next sh
End Sub


Thanks.



Don Guillett wrote:
As always, post your coding efforts for comments and suggestions.

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Hi all,

I'm new to VBA and could use some help. I'm trying to have a macro
perform the same function (paste a rectangle) across several selected
sheets (say, 1-4,7,9,10 of 10). I can get the macro to paste the
rectangle across ALL the sheets, but I only want it on those selected.
Any ideas?

Thanks in advance,
Stephan




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro to Perform Same Function Across Selected Sheets

thanks!


Don Guillett wrote:
Sub ss()
For Each ws In ActiveWindow.SelectedSheets
MsgBox ws.Name
Next ws
End Sub


--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Here's the code I currently have:

Sub CoverStopwatch()
'
' CoverStopwatch Macro
'
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.Select
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 3.75, 39.75, 79.5,
37.5). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 4.5, 540#, 82.5,
21.75). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
Range("Q1:V1").Select
Next sh
End Sub


Thanks.



Don Guillett wrote:
As always, post your coding efforts for comments and suggestions.

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Hi all,

I'm new to VBA and could use some help. I'm trying to have a macro
perform the same function (paste a rectangle) across several selected
sheets (say, 1-4,7,9,10 of 10). I can get the macro to paste the
rectangle across ALL the sheets, but I only want it on those selected.
Any ideas?

Thanks in advance,
Stephan





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro to Perform Same Function Across Selected Sheets

Glad to help

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
thanks!


Don Guillett wrote:
Sub ss()
For Each ws In ActiveWindow.SelectedSheets
MsgBox ws.Name
Next ws
End Sub


--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Here's the code I currently have:

Sub CoverStopwatch()
'
' CoverStopwatch Macro
'
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.Select
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 3.75, 39.75, 79.5,
37.5). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 4.5, 540#, 82.5,
21.75). _
Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 19
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.Shadow.Visible = msoFalse
Range("Q1:V1").Select
Next sh
End Sub


Thanks.



Don Guillett wrote:
As always, post your coding efforts for comments and suggestions.

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Hi all,

I'm new to VBA and could use some help. I'm trying to have a macro
perform the same function (paste a rectangle) across several
selected
sheets (say, 1-4,7,9,10 of 10). I can get the macro to paste the
rectangle across ALL the sheets, but I only want it on those
selected.
Any ideas?

Thanks in advance,
Stephan





Reply
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
Macro to run on selected sheets terilad Excel Discussion (Misc queries) 18 April 7th 10 03:14 PM
How to run macro on selected sheets with one go? Harshad[_2_] Excel Discussion (Misc queries) 10 October 21st 08 10:35 AM
Perform Row Function Using Macro mvyvoda Excel Programming 4 January 14th 06 06:46 PM
Challenging Macro to perform evaluate function on each cell qwertyjuan Excel Programming 5 November 20th 05 07:30 PM
Getting a macro to perform a function on a certain day every week. Ian M[_2_] Excel Programming 2 July 19th 04 03:30 AM


All times are GMT +1. The time now is 09:49 AM.

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"