LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Anthony
 
Posts: n/a
Default

Hi,
well basically I have several bits of data which has been input by the user
on a 'order form' and I want a macro to create a new worksheet for each new
order placed calling it the name given in cell ref A1. Also I want all the
other data copy/pasted into this new worksheet from the original 'order form'
hope this is clear and thanks for help this far

"tjtjjtjt" wrote:

Do you have a larger plan in mind? This does what you are asking, but with
more information, someone could probably come up with something better.

Sub NewSheet()
Dim x As Worksheet
Dim y As Worksheet
Dim z As Variant

Set x = ActiveSheet
Sheets.Add
ActiveSheet.Name = x.Range("A1")
Set y = ActiveSheet

z = Array(x.Range("B2"), x.Range("C3"), x.Range("D4"))
y.Range("X1") = z(0)
y.Range("Y2") = z(1)
y.Range("Z3") = z(2)

End Sub

--
tj


"Anthony" wrote:

thanks for help - I'll give it go,
one other thing, I assume if I want also to paste some text into this newly
created worksheet from the first sheet this can also be done,
ie the new worksheet is created and renamed Bloggs,Joe (as this is entered
into cell A1), and cells B2,C3,D4 and copied from this sheet and pasted into
cells X1,Y2,Z3 of the new worksheet.
thanks again

"tjtjjtjt" wrote:

One way:

Sub NewSheet()
Dim x As Worksheet
Set x = ActiveSheet
Sheets.Add
ActiveSheet.Name = x.Range("A1")
End Sub

--
tj


"Anthony" wrote:

Hi all,
is there a way to copy the name a user inputs (say in cell ref A1) and
create a new worksheet within my current workbook with this 'name' using a
macro ??.
ie
the user inputs Bloggs,Joe into cell ref A1, and once the macro is selected
a new worksheet is created with the 'tab' now changed to Bloggs,Joe - instead
of Sheet1, Sheet2 etc etc
thanks
PSA
I'm a novice -so sorry if this is simple

 
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
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Macro and sub rountines The Good Deeds Team Excel Discussion (Misc queries) 1 March 23rd 05 11:26 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 02:27 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"