A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro



 
 
Thread Tools Display Modes
  #1  
Old October 6th, 2003, 07:28 PM
Nicole
external usenet poster
 
Posts: n/a
Default Macro

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").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").Select
Selection.EntireColumn.Hidden = True
Range("A3").Select
End Sub
  #2  
Old October 6th, 2003, 08:10 PM
Danny
external usenet poster
 
Posts: n/a
Default Macro

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.
-----Original Message-----
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").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").Select
Selection.EntireColumn.Hidden = True
Range("A3").Select
End Sub
.

  #3  
Old October 6th, 2003, 08:26 PM
Nicole
external usenet poster
 
Posts: n/a
Default Macro

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.
-----Original Message-----
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.
-----Original Message-----
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").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").Select
Selection.EntireColumn.Hidden = True
Range("A3").Select
End Sub
.

.

  #4  
Old October 6th, 2003, 09:37 PM
Danny
external usenet poster
 
Posts: n/a
Default Macro

Yes, that is all. Cut your current macro and paste it in
the module.

-----Original Message-----
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.
-----Original Message-----
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.
-----Original Message-----
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").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").Select
Selection.EntireColumn.Hidden = True
Range("A3").Select
End Sub
.

.

.

  #5  
Old October 9th, 2003, 09:53 PM
Steve Smallman
external usenet poster
 
Posts: n/a
Default Macro

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

"Nicole" wrote in message
...
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").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").Select
Selection.EntireColumn.Hidden = True
Range("A3").Select
End Sub



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.