Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello
I'm just having a really bad day I guess. I was wondering if some kind soul could help. I have created 12 macros called pastejanuary, pastefebruary, pastemarch etc etc etc. These are pastespecial operations. What I would like to do is if the cell $g$1 changes from january to february, run the macro called pastefebruary. Any ideas would be greatly appreciated. I created private sub worksheet_change(by val target as excel range and then asked for the range $g$1 and range value of February but thats where I ran into trouble. I cannot for the life of me get it to run the pastefebruary macro. I really would appreciate any help you could give me Cheers |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this: http://support.microsoft.com/?kbid=142154
************ Hope it helps! Anne Troy www.OfficeArticles.com "mjb2005" wrote in message oups.com... Hello I'm just having a really bad day I guess. I was wondering if some kind soul could help. I have created 12 macros called pastejanuary, pastefebruary, pastemarch etc etc etc. These are pastespecial operations. What I would like to do is if the cell $g$1 changes from january to february, run the macro called pastefebruary. Any ideas would be greatly appreciated. I created private sub worksheet_change(by val target as excel range and then asked for the range $g$1 and range value of February but thats where I ran into trouble. I cannot for the life of me get it to run the pastefebruary macro. I really would appreciate any help you could give me Cheers |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Anne
I did try this earlier on but I probably should have been a bit clearer for everyone in that I don't really want to run just one macro because (maybe a bit stupidly) I have created 12 different macros for each month and when the month changes say to March, I only want to run the March Macro. Clear as mud? Thanks again Anne Troy wrote: Try this: http://support.microsoft.com/?kbid=142154 ************ Hope it helps! Anne Troy www.OfficeArticles.com "mjb2005" wrote in message oups.com... Hello I'm just having a really bad day I guess. I was wondering if some kind soul could help. I have created 12 macros called pastejanuary, pastefebruary, pastemarch etc etc etc. These are pastespecial operations. What I would like to do is if the cell $g$1 changes from january to february, run the macro called pastefebruary. Any ideas would be greatly appreciated. I created private sub worksheet_change(by val target as excel range and then asked for the range $g$1 and range value of February but thats where I ran into trouble. I cannot for the life of me get it to run the pastefebruary macro. I really would appreciate any help you could give me Cheers |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("G1")) Is Nothing Then With Target Select Case LCase(.Value) Case "january": PasteJanuary Case "february": PasteFebruary 'etc. End Select End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (remove nothere from the email address if mailing direct) "mjb2005" wrote in message oups.com... Hello I'm just having a really bad day I guess. I was wondering if some kind soul could help. I have created 12 macros called pastejanuary, pastefebruary, pastemarch etc etc etc. These are pastespecial operations. What I would like to do is if the cell $g$1 changes from january to february, run the macro called pastefebruary. Any ideas would be greatly appreciated. I created private sub worksheet_change(by val target as excel range and then asked for the range $g$1 and range value of February but thats where I ran into trouble. I cannot for the life of me get it to run the pastefebruary macro. I really would appreciate any help you could give me Cheers |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dear Bob
I must thank you so much. I am new to vb and even though I was sort of on the right track, I just couldn't get the old grey matter around it. I really appreciate your help Thank you again Marlene |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It's a pleasure Marlene.
Bob "mjb2005" wrote in message ups.com... Dear Bob I must thank you so much. I am new to vb and even though I was sort of on the right track, I just couldn't get the old grey matter around it. I really appreciate your help Thank you again Marlene |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run a macro in a locked cell | Excel Discussion (Misc queries) | |||
Can a macro be made to run on entering or leaving a cell? | Excel Discussion (Misc queries) | |||
Macro code for dropping to next empty cell | Excel Discussion (Misc queries) | |||
Keyboard Macro Just Copies Content of Previous Cell | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions |