![]() |
copy data from new worksheet to master list
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 |
copy data from new worksheet to master list
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 |
copy data from new worksheet to master list
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 |
copy data from new worksheet to master list
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 |
All times are GMT +1. The time now is 10:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com