Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro assistance


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Macro assistance

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro assistance


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO assistance MrDave Excel Discussion (Misc queries) 1 August 12th 09 01:10 PM
Macro assistance Rover Excel Worksheet Functions 11 March 17th 09 04:30 PM
VBA Macro Assistance (I am desperate) adncmm1980[_2_] Excel Programming 1 October 4th 04 02:01 PM
VBA Macro Assistance (I am desperate) adncmm1980 Excel Programming 2 October 3rd 04 11:09 PM
Macro assistance required please [email protected] Excel Programming 0 November 7th 03 08:30 AM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"