I have been looking at various options for solving this problem but cannot seem to find the solution. Appreciate any help. I am using Excel03.
I have a listbox with 3 items(1,2,&3) and if I select 1, 2, or 3 the selected value will appear in cell A1.
Now based on this I want to run macro 1 if 1 is selected (A1=1),
run macro 2 if 2 is selected (A1=2),
run macro 3 if 3 is selected (A1=3).
But I am having no joy and would appreciate any pointers/advice.
this is what I have so far
Sub CopyPaste1_2() If a1 = 1 Then CopyPaste1 ElseIf a1 = 2 Then CopyPaste2 End If 'CopyPaste3 'DeletePaste End Sub
Sub CopyPaste1()
Range("D1").Select
Selection.Copy
Range("F1").Select
ActiveSheet.Paste
End Sub
Sub CopyPaste2()
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Range("F2").Select
ActiveSheet.Paste
End Sub
Sub CopyPaste3()
Range("D3").Select
Application.CutCopyMode = False
Selection.Copy
Range("F3").Select
ActiveSheet.Paste
End Sub
Sub DeletePaste()
Columns("F:F").Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub


Sign In
Create Account

Back to top









