Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Replacing macro buttons with a new set of buttons

I have about a hundred sheets in a workbook that each have six individual
buttons I created for running various macros.
I have since redesigned them and want to replace the old 5 buttons with 5
new ones (eliminating one button). I have grouped the new buttons so I
could just paste them as one item (hopefully using a macro. I could of
course ungroup them if this would make it any easier to work with). The
new buttons are slightly larger than the old ones and are in a slightly
different location. The new buttons are on a worksheet called "Blank".
The other worksheets have different Customer numbers as names.
What would be the easiest way to delete the old buttons and place the new
ones on each sheet?

Thanks in advance for your expert help. All you guys are great!

Jonco


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Replacing macro buttons with a new set of buttons

Correction: I have 6 buttons I want to replace with 5 redesigned buttons.


"jonco" wrote in message
. net...
I have about a hundred sheets in a workbook that each have six individual
buttons I created for running various macros.
I have since redesigned them and want to replace the old 5 buttons with 5
new ones (eliminating one button). I have grouped the new buttons so I
could just paste them as one item (hopefully using a macro. I could of
course ungroup them if this would make it any easier to work with). The
new buttons are slightly larger than the old ones and are in a slightly
different location. The new buttons are on a worksheet called "Blank".
The other worksheets have different Customer numbers as names.
What would be the easiest way to delete the old buttons and place the new
ones on each sheet?

Thanks in advance for your expert help. All you guys are great!

Jonco



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Replacing macro buttons with a new set of buttons

Here's what I have so far. I'm getting a "NEXT with No FOR error".
But i have a FOR.

Help please

Sub ReplaceButtons()
'
' ReplaceButtons Macro

For Each Worksheet In ThisWorkbook.Worksheets
Select Case Worksheet.Name
Case "Index", "Trans", "Customers"
'don't do anything
Case Else
Worksheet.Unprotect
CurrentSheet = ActiveSheet.Name
ActiveSheet.Unprotect
' Select old buttons to replace
ActiveSheet.Shapes.Range(Array("Button 1", "Button 2", "Button 3",
"Button 4" _
, "Button 5", "Button 6")).Select
Selection.Cut
Sheets("Blank").Select
ActiveSheet.Unprotect
ActiveSheet.Shapes("Group 15").Select
Selection.Copy
Worksheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets(CurrentSheet).Select ' Selects current customer sheet
Range("A3").Select
ActiveSheet.Paste
Worksheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Next
MsgBox "done"

End Sub




"jonco" wrote in message
. net...
I have about a hundred sheets in a workbook that each have six individual
buttons I created for running various macros.
I have since redesigned them and want to replace the old 5 buttons with 5
new ones (eliminating one button). I have grouped the new buttons so I
could just paste them as one item (hopefully using a macro. I could of
course ungroup them if this would make it any easier to work with). The
new buttons are slightly larger than the old ones and are in a slightly
different location. The new buttons are on a worksheet called "Blank".
The other worksheets have different Customer numbers as names.
What would be the easiest way to delete the old buttons and place the new
ones on each sheet?

Thanks in advance for your expert help. All you guys are great!

Jonco



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Replacing macro buttons with a new set of buttons

You're missing an End Select statement.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"jonco" wrote in message
. com...
Here's what I have so far. I'm getting a "NEXT with No FOR
error". But i have a FOR.

Help please

Sub ReplaceButtons()
'
' ReplaceButtons Macro

For Each Worksheet In ThisWorkbook.Worksheets
Select Case Worksheet.Name
Case "Index", "Trans", "Customers"
'don't do anything
Case Else
Worksheet.Unprotect
CurrentSheet = ActiveSheet.Name
ActiveSheet.Unprotect
' Select old buttons to replace
ActiveSheet.Shapes.Range(Array("Button 1", "Button 2",
"Button 3", "Button 4" _
, "Button 5", "Button 6")).Select
Selection.Cut
Sheets("Blank").Select
ActiveSheet.Unprotect
ActiveSheet.Shapes("Group 15").Select
Selection.Copy
Worksheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets(CurrentSheet).Select ' Selects current customer
sheet
Range("A3").Select
ActiveSheet.Paste
Worksheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True

Next
MsgBox "done"

End Sub




"jonco" wrote in message
. net...
I have about a hundred sheets in a workbook that each have six
individual buttons I created for running various macros.
I have since redesigned them and want to replace the old 5
buttons with 5 new ones (eliminating one button). I have
grouped the new buttons so I could just paste them as one item
(hopefully using a macro. I could of course ungroup them if
this would make it any easier to work with). The new buttons
are slightly larger than the old ones and are in a slightly
different location. The new buttons are on a worksheet called
"Blank". The other worksheets have different Customer numbers
as names.
What would be the easiest way to delete the old buttons and
place the new ones on each sheet?

Thanks in advance for your expert help. All you guys are
great!

Jonco





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
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
Form buttons vs. ActiveX Buttons GeorgeJ Excel Discussion (Misc queries) 3 August 11th 07 09:02 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
pivot chart is it possible to hide individual field buttons? Layout Field buttons Matt Charts and Charting in Excel 0 August 27th 06 02:57 PM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 07:16 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"