PC Review


Reply
Thread Tools Rate Thread

Cell values from mulitiple worksheets to two columns on another ws

 
 
=?Utf-8?B?TWlrZSBL?=
Guest
Posts: n/a
 
      2nd Apr 2007
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 With Quote
 
 
 
 
=?Utf-8?B?QXJ0?=
Guest
Posts: n/a
 
      2nd Apr 2007
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 With Quote
 
=?Utf-8?B?TWlrZSBL?=
Guest
Posts: n/a
 
      3rd Apr 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I enter data simultaneously on mulitiple worksheets? carolinagirl0050 Microsoft Excel Setup 1 21st Jul 2009 05:41 PM
Comparing common values in either different worksheets or columns Cesar Microsoft Excel Misc 1 7th May 2009 03:49 AM
how to compare/sort values in two columns of two worksheets? pemt Microsoft Excel Misc 4 21st Jan 2009 10:22 PM
How do I summarize items chosen on mulitiple worksheets =?Utf-8?B?U3Vuc2hpbmU=?= Microsoft Excel Worksheet Functions 0 26th Sep 2007 04:52 PM
Alphabetizing mulitiple worksheets in Excel 2003? =?Utf-8?B?RGVlbmEgYXQgRENIIEZE?= Microsoft Excel Misc 2 13th Jun 2006 04:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 AM.