Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
help to copy and paste with VB
I need help to do the following
i need to copy and paste adresses from on sheet to another depending on the cell value EXAMPLE: IF cell a2 on sheet 1 says "1" then copy the address (cells a1 to a5 on sheet 1) to cells d1 to d5 on sheet 2 if cell A2 on sheet 1 says "54" then copy THAT address (cells a1 to a5 on sheet 1) to cells d10 to d15 on sheet 2 ANYONES HELP WOULD BE VERY APPRECIATED thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
help to copy and paste with VB
I'm not entirely clear what you want to do, but you might try
some code like Select Case Worksheets("Sheet2").Range("A2").Value Case 1 Range("A1:A5").Copy Destination:=Worksheets("Sheet2").Range("D1") Case 54 Range("A1:A5").Copy Destination:=Worksheets("Sheet2").Range("D10") End Select -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "ian123" wrote in message ... I need help to do the following i need to copy and paste adresses from on sheet to another depending on the cell value EXAMPLE: IF cell a2 on sheet 1 says "1" then copy the address (cells a1 to a5 on sheet 1) to cells d1 to d5 on sheet 2 if cell A2 on sheet 1 says "54" then copy THAT address (cells a1 to a5 on sheet 1) to cells d10 to d15 on sheet 2 ANYONES HELP WOULD BE VERY APPRECIATED thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
help to copy and paste with VB
The code got line-wrapped in the post. The Destination argument
should be on the same line as Copy. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... I'm not entirely clear what you want to do, but you might try some code like Select Case Worksheets("Sheet2").Range("A2").Value Case 1 Range("A1:A5").Copy Destination:=Worksheets("Sheet2").Range("D1") Case 54 Range("A1:A5").Copy Destination:=Worksheets("Sheet2").Range("D10") End Select -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "ian123" wrote in message ... I need help to do the following i need to copy and paste adresses from on sheet to another depending on the cell value EXAMPLE: IF cell a2 on sheet 1 says "1" then copy the address (cells a1 to a5 on sheet 1) to cells d1 to d5 on sheet 2 if cell A2 on sheet 1 says "54" then copy THAT address (cells a1 to a5 on sheet 1) to cells d10 to d15 on sheet 2 ANYONES HELP WOULD BE VERY APPRECIATED thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
Copy / Paste Warning | Excel Discussion (Misc queries) | |||
Macro to find, copy, and paste until value change | Excel Worksheet Functions | |||
Macro to open workbook and copy and paste values in to orig workbo | Excel Worksheet Functions | |||
Can't Copy and Paste between Excel 2003 Workbooks | Excel Discussion (Misc queries) |