Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell values from mulitiple worksheets to two columns on another ws
Oh Wise Ones,
I have browsed some previous posts for a similar request but I could not find an example that I was capable of editing for my purpose. Heres what I would like to accomplish. I have multiple worksheets in a workbook and more may be added at any time. I need to retrieved the values in cells F2(Date reported) and F4(Date of Incident) from ALL other existing worksheets and place them in column H and J respectively of a worksheet called "Control" in the same workbook. Obviously the range in column H and J would automatically grow as more sheets are added. Any help would be appreciated. Thanks, Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell values from mulitiple worksheets to two columns on another ws
Try this:
Sub test() Dim ws As Worksheet Dim i As Integer For Each ws In Worksheets If ws.Name < "Control" Then i = i + 1 Sheets("Control").Cells(i, 8) = ws.Cells(2, 6) Sheets("Control").Cells(i, 10) = ws.Cells(4, 6) End If Next End Sub This code would be placed in a new module. "Mike K" wrote: Oh Wise Ones, I have browsed some previous posts for a similar request but I could not find an example that I was capable of editing for my purpose. Heres what I would like to accomplish. I have multiple worksheets in a workbook and more may be added at any time. I need to retrieved the values in cells F2(Date reported) and F4(Date of Incident) from ALL other existing worksheets and place them in column H and J respectively of a worksheet called "Control" in the same workbook. Obviously the range in column H and J would automatically grow as more sheets are added. Any help would be appreciated. Thanks, Mike |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell values from mulitiple worksheets to two columns on anothe
Thanks Art! You guys are awesome!
Mike "Art" wrote: Try this: Sub test() Dim ws As Worksheet Dim i As Integer For Each ws In Worksheets If ws.Name < "Control" Then i = i + 1 Sheets("Control").Cells(i, 8) = ws.Cells(2, 6) Sheets("Control").Cells(i, 10) = ws.Cells(4, 6) End If Next End Sub This code would be placed in a new module. "Mike K" wrote: Oh Wise Ones, I have browsed some previous posts for a similar request but I could not find an example that I was capable of editing for my purpose. Heres what I would like to accomplish. I have multiple worksheets in a workbook and more may be added at any time. I need to retrieved the values in cells F2(Date reported) and F4(Date of Incident) from ALL other existing worksheets and place them in column H and J respectively of a worksheet called "Control" in the same workbook. Obviously the range in column H and J would automatically grow as more sheets are added. Any help would be appreciated. Thanks, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter data simultaneously on mulitiple worksheets? | Setting up and Configuration of Excel | |||
Mulitiple Count of occurrences in different columns | Excel Worksheet Functions | |||
How do I summarize items chosen on mulitiple worksheets | Excel Worksheet Functions | |||
Alphabetizing mulitiple worksheets in Excel 2003? | Excel Discussion (Misc queries) | |||
select mulitiple columns and items from a listbox | Excel Programming |