PC Review


Reply
Thread Tools Rate Thread

copy data from new worksheet to master list

 
 
Texas Aggie
Guest
Posts: n/a
 
      25th Jun 2008
am creating an application that has three master sheets and a template. Sheet
2 holds the data for an unknown list of sheets. I have a userform that allows
the user to copy the template worksheet and give it a unique name. That name
is stored in the database on sheet two. Sheet 2 looks like this.

A B C D
1. Sheet Name Data 1 Data 2 Data 3
2. New Sheet1 NewSheet1!A1 NewSheet1!B1 NewSheet1!C1

I need to figure out how to take data from the new sheet's Cell A1 B1 and C1
and copy it to it's corresponding position on the database in Sheet 2. I hope
that I explained it well. Any help would be appreciated.


--

Fighting Texas Aggie Class of 2009
 
Reply With Quote
 
 
 
 
Office_Novice
Guest
Posts: n/a
 
      25th Jun 2008
I fi read this right you can just reference the cells, no? maybe a Vlookup
function? Have a look here
http://www.contextures.com/xlFunctions02.html

"Texas Aggie" wrote:

> am creating an application that has three master sheets and a template. Sheet
> 2 holds the data for an unknown list of sheets. I have a userform that allows
> the user to copy the template worksheet and give it a unique name. That name
> is stored in the database on sheet two. Sheet 2 looks like this.
>
> A B C D
> 1. Sheet Name Data 1 Data 2 Data 3
> 2. New Sheet1 NewSheet1!A1 NewSheet1!B1 NewSheet1!C1
>
> I need to figure out how to take data from the new sheet's Cell A1 B1 and C1
> and copy it to it's corresponding position on the database in Sheet 2. I hope
> that I explained it well. Any help would be appreciated.
>
>
> --
>
> Fighting Texas Aggie Class of 2009

 
Reply With Quote
 
Texas Aggie
Guest
Posts: n/a
 
      25th Jun 2008
I would use Vlookup if I knew in advance what the sheet name would be
--


Fighting Texas Aggie Class of 2009


"Office_Novice" wrote:

> I fi read this right you can just reference the cells, no? maybe a Vlookup
> function? Have a look here
> http://www.contextures.com/xlFunctions02.html
>
> "Texas Aggie" wrote:
>
> > am creating an application that has three master sheets and a template. Sheet
> > 2 holds the data for an unknown list of sheets. I have a userform that allows
> > the user to copy the template worksheet and give it a unique name. That name
> > is stored in the database on sheet two. Sheet 2 looks like this.
> >
> > A B C D
> > 1. Sheet Name Data 1 Data 2 Data 3
> > 2. New Sheet1 NewSheet1!A1 NewSheet1!B1 NewSheet1!C1
> >
> > I need to figure out how to take data from the new sheet's Cell A1 B1 and C1
> > and copy it to it's corresponding position on the database in Sheet 2. I hope
> > that I explained it well. Any help would be appreciated.
> >
> >
> > --
> >
> > Fighting Texas Aggie Class of 2009

 
Reply With Quote
 
Texas Aggie
Guest
Posts: n/a
 
      25th Jun 2008
After doing some more research I come upon the solution to my own problem

The code is:

Sub test()

Dim c As Range
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet 2")

With ws
For Each c In Application.Intersect(.UsedRange, .Range("A2:A100"))
If c.Value = "" Then

Else
c.Offset(0, 1).Value = "='" & c.Value & "'!A1"
c.Offset(0, 2).Value = "='" & c.Value & "'!B1"


End If
Next c

End With
End Sub
--

Fighting Texas Aggie Class of 2009


"Texas Aggie" wrote:

> am creating an application that has three master sheets and a template. Sheet
> 2 holds the data for an unknown list of sheets. I have a userform that allows
> the user to copy the template worksheet and give it a unique name. That name
> is stored in the database on sheet two. Sheet 2 looks like this.
>
> A B C D
> 1. Sheet Name Data 1 Data 2 Data 3
> 2. New Sheet1 NewSheet1!A1 NewSheet1!B1 NewSheet1!C1
>
> I need to figure out how to take data from the new sheet's Cell A1 B1 and C1
> and copy it to it's corresponding position on the database in Sheet 2. I hope
> that I explained it well. Any help would be appreciated.
>
>
> --
>
> Fighting Texas Aggie Class of 2009

 
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
autofilter master copy data to worksheet Hobbes Microsoft Excel Programming 1 22nd May 2010 01:15 PM
Copy and pasting specific sheet data to a master worksheet simora Microsoft Excel Programming 4 9th May 2005 05:30 AM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie Microsoft Excel Programming 2 22nd Sep 2004 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie Microsoft Excel Programming 0 22nd Sep 2004 03:26 PM
Copy ranges of data from Master worksheet. Thanks Prefcustmer@Yahoo.com Microsoft Excel Programming 4 24th Nov 2003 03:28 AM


Features
 

Advertising
 

Newsgroups
 


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