Macro to run based on criteria

P

puiuluipui

Hi, i need a macro to run based on a criteria in A1.
In A1 i have a dropdown list with sheets name. If i select in A1 the sheet
John, and then i run the macro, i need the macro to copy some cells from the
sheet John.
If i select in A1 the sheet Mary, then the macro to copy from sheet Mary.
Can this be done?
Thanks!
 
J

Jackpot

Yes. Try the below...




With Sheets(CStr(Range("A1")))
..Range("A1:A10").Copy Sheets("Sheet1").Range("B1")
End With
 
P

puiuluipui

This is perfect!
Thanks!

Jackpot said:
Yes. Try the below...




With Sheets(CStr(Range("A1")))
.Range("A1:A10").Copy Sheets("Sheet1").Range("B1")
End With
 

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