Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Tom- Thanks so much for the macro! I just did a test run and it seems to work. I just wish I understood it...thanks, again. Tom Ogilvy Wrote: Sub CopyData() Dim rng1 as Range, cell as Range Dim bk1 as Workbook, bk2 as Workbook Dim sh1 as Worksheet, sh2 as Worksheet Dim rw as Long, icol as Long set bk1 = Workbooks("Workbook1.xls") set bk2 = Workbooks("Workbook2.xls") set sh1 = bk1.Worksheets(1) set sh2 = bk2.Worksheets(1) set rng1 = sh1.Range(sh1.Cells(2,1),sh1.Cells(2,1).End(xldown )) rw = 2 for each cell in rng1 sh2.Cells(rw,1).Value = cell.offset(0,1).Value Select Case Cell.Value Case 1 icol = 4 Case 2 icol = 5 Case 3 icol = 3 Case Else icol = 2 End Select sh2.Cells(rw,icol).Value = cell.offset(0,2).Value rw = rw + 1 Next End Sub -- Regards, Tom Ogilvy -- marlea ------------------------------------------------------------------------ marlea's Profile: http://www.excelforum.com/member.php...o&userid=26209 View this thread: http://www.excelforum.com/showthread...hreadid=465944 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you use sumproduct to return specific cell data? | Excel Worksheet Functions | |||
Search for a number in a table and return data of a specific cell | Excel Discussion (Misc queries) | |||
How to return a specific data point from a large array if I don't know the exact location? | Excel Discussion (Misc queries) | |||
search multiple sheets for specific date, return data in cell to r | Excel Discussion (Misc queries) | |||
import data to specific columns | Excel Discussion (Misc queries) |