close

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
CheersTry this: support.microsoft.com/?kbid=142154
************
Hope it helps!
Anne Troy
www.OfficeArticles.com

quot;mjb2005quot; gt; wrote in message oups.com...
gt; Hello
gt; I'm just having a really bad day I guess. I was wondering if some kind
gt; soul could help.
gt; I have created 12 macros called pastejanuary, pastefebruary, pastemarch
gt; etc etc etc. These are pastespecial operations.
gt; What I would like to do is if the cell $g$1 changes from january to
gt; february, run the macro called pastefebruary.
gt; Any ideas would be greatly appreciated. I created private sub
gt; worksheet_change(by val target as excel range and then asked for the
gt; range $g$1 and range value of February but thats where I ran into
gt; trouble.
gt; I cannot for the life of me get it to run the pastefebruary macro.
gt;
gt; I really would appreciate any help you could give me
gt; Cheers
gt;
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:

gt; Try this: support.microsoft.com/?kbid=142154
gt; ************
gt; Hope it helps!
gt; Anne Troy
gt; www.OfficeArticles.com
gt;
gt; quot;mjb2005quot; gt; wrote in message
gt; oups.com...
gt; gt; Hello
gt; gt; I'm just having a really bad day I guess. I was wondering if some kind
gt; gt; soul could help.
gt; gt; I have created 12 macros called pastejanuary, pastefebruary, pastemarch
gt; gt; etc etc etc. These are pastespecial operations.
gt; gt; What I would like to do is if the cell $g$1 changes from january to
gt; gt; february, run the macro called pastefebruary.
gt; gt; Any ideas would be greatly appreciated. I created private sub
gt; gt; worksheet_change(by val target as excel range and then asked for the
gt; gt; range $g$1 and range value of February but thats where I ran into
gt; gt; trouble.
gt; gt; I cannot for the life of me get it to run the pastefebruary macro.
gt; gt;
gt; gt; I really would appreciate any help you could give me
gt; gt; Cheers
gt; gt;Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(quot;G1quot;)) Is Nothing Then
With Target
Select Case LCase(.Value)
Case quot;januaryquot;: PasteJanuary
Case quot;februaryquot;: 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)

quot;mjb2005quot; gt; wrote in message oups.com...
gt; Hello
gt; I'm just having a really bad day I guess. I was wondering if some kind
gt; soul could help.
gt; I have created 12 macros called pastejanuary, pastefebruary, pastemarch
gt; etc etc etc. These are pastespecial operations.
gt; What I would like to do is if the cell $g$1 changes from january to
gt; february, run the macro called pastefebruary.
gt; Any ideas would be greatly appreciated. I created private sub
gt; worksheet_change(by val target as excel range and then asked for the
gt; range $g$1 and range value of February but thats where I ran into
gt; trouble.
gt; I cannot for the life of me get it to run the pastefebruary macro.
gt;
gt; I really would appreciate any help you could give me
gt; Cheers
gt;
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
MarleneIt's a pleasure Marlene.

Bob

quot;mjb2005quot; gt; wrote in message ups.com...
gt; Dear Bob
gt; I must thank you so much. I am new to vb and even though I was sort of
gt; on the right track, I just couldn't get the old grey matter around it.
gt; I really appreciate your help
gt; Thank you again
gt; Marlene
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()