Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Macro to run based on criteria

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Macro to run based on criteria

Yes. Try the below...




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


"puiuluipui" wrote:

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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Macro to run based on criteria

This is perfect!
Thanks!

"Jackpot" wrote:

Yes. Try the below...




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


"puiuluipui" wrote:

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to add numbers based on set criteria David Excel Discussion (Misc queries) 6 October 13th 09 06:01 PM
macro to delete a row based on criteria aileen Excel Programming 3 September 29th 08 02:49 PM
Macro to hide rows based on criteria Santa-D Excel Programming 5 July 1st 08 09:08 AM
offset macro based on multiple criteria davemon Excel Discussion (Misc queries) 1 September 21st 07 03:15 PM
Macro to auto Name a Range based on criteria Mike R. Excel Programming 2 July 29th 05 04:59 AM


All times are GMT +1. The time now is 04:08 AM.

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

About Us

"It's about Microsoft Excel"