Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am writing a macro that takes data from one table adds it to another table, titles the new sheet and then loops down to the next set of data and starts all over again. My question is this: How do I name the new sheet in the vba so it can recognize it through out the code. This is what I am doing but I don't know how to call the new sheet with the new name. Thanks for any suggestions on this method or if there is a better way to go about this process. Sheets("FlatCustomers").Select Cells(2, 2).Select Selection.Copy Sheets.Add Range("B3").Select ActiveSheet.Paste Range("B3").Select ActiveSheet.Name = Range("B3").Value Sheets("FlatCustomers").Select Cells(3, 2).Select Selection.Copy -- dthompson ------------------------------------------------------------------------ dthompson's Profile: http://www.excelforum.com/member.php...o&userid=25002 View this thread: http://www.excelforum.com/showthread...hreadid=385268 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sNew = Range("B3").Value
Sheets.Add.Name = sNew Sheets("FlatCustomers").Cells(2, 2).Copy Worksheets(sNew).Range("B3") Sheets("FlatCustomers").Cells(3, 2).Copy Worksheets(sNew).Range("B4") etc. -- HTH Bob Phillips "dthompson" wrote in message ... I am writing a macro that takes data from one table adds it to another table, titles the new sheet and then loops down to the next set of data and starts all over again. My question is this: How do I name the new sheet in the vba so it can recognize it through out the code. This is what I am doing but I don't know how to call the new sheet with the new name. Thanks for any suggestions on this method or if there is a better way to go about this process. Sheets("FlatCustomers").Select Cells(2, 2).Select Selection.Copy Sheets.Add Range("B3").Select ActiveSheet.Paste Range("B3").Select ActiveSheet.Name = Range("B3").Value Sheets("FlatCustomers").Select Cells(3, 2).Select Selection.Copy -- dthompson ------------------------------------------------------------------------ dthompson's Profile: http://www.excelforum.com/member.php...o&userid=25002 View this thread: http://www.excelforum.com/showthread...hreadid=385268 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Disregard I figured it ou -- dthompso ----------------------------------------------------------------------- dthompson's Profile: http://www.excelforum.com/member.php...fo&userid=2500 View this thread: http://www.excelforum.com/showthread.php?threadid=38526 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MACRO assistance | Excel Discussion (Misc queries) | |||
Macro assistance | Excel Worksheet Functions | |||
VBA Macro Assistance (I am desperate) | Excel Programming | |||
VBA Macro Assistance (I am desperate) | Excel Programming | |||
Macro assistance required please | Excel Programming |