Macro

N

Nicole

I have created a macro in a workbook that has multiply
worksheets (tabs). The macro works great on the worksheet
where the macro was created. However, when I move to a
different "tab", the macro goes back to tab where is was
created and runs the macro. I want to create/change my
macro to a "universal" marco, where I can go to any "tab"
and the macro will function properly. To follow is the
script for my macro. Thanks for any help.



Sub quickfix()
'
' quickfix Macro
' Macro recorded 9/15/2003 by nnoonchester
'
' Keyboard Shortcut: Ctrl+u
'
Sheets("Chandler, Darrell (2)").Select
Columns("D:E").Select
Range("D4").Activate
Selection.Copy
Sheets("Sheet1 (126)").Select
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Sheets("Chandler, Darrell (2)").Select
Columns("H:H").Select
Range("H4").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (126)").Select
Columns("H:H").Select
Selection.Insert Shift:=xlToRight
Sheets("Chandler, Darrell (2)").Select
Range("F9:G48").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (126)").Select
Range("F9").Select
ActiveSheet.Paste
Sheets("Chandler, Darrell (2)").Select
Range("I10:I48").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1 (126)").Select
Range("I10").Select
ActiveSheet.Paste
Columns("D:D").Select
Selection.EntireColumn.Hidden = True
Range("A3").Select
End Sub
 
D

Danny

Your macro is in particular sheet. Move it to a module. If
you don't have a module in your VBA project, click your
VBA project and a insert a module.
 
N

Nicole

I do have a module. How do I move the macro and is that
all that is needed? Sorry to sound stupid, I learned
Macros the old long way and in Lotus. Thanks.
 
S

Steve Smallman

Nicole,

Remove the line "Sheets("Chandler, Darrell (2)").Select". This is what is
causing you grief. This line forces the macro to return to the Chandler.....
(2) Sheet

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top