LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Anthony
 
Posts: n/a
Default Easy VB code question

Hi,
I'm the novice so I'm sure this will be easy for you guys.
Ok I have a macro to create a new worksheet for a new order placed. The
worksheet is named from the input data from cell B2.
The code will copy some data into the new worksheet and then use a message
box to acknowledge that the order has been placed.
What I can't get to work is that I want this msg box to be shown back in
the original 'order form' worksheet and not the newly created one.
ie I want all the selected data from the order to be pasted into the new
worksheet - and the only notice that this has been done will be the msg box !
hope I have made that clear, and here is my code

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

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

z = Array(x.Range("B2"), x.Range("B4")

y.Range("B3") = z(0) 'NAME
y.Range("D3") = z(1) 'BOOKING REF

End With
MsgBox "Thank You, Order Created Successfully !", vbInformation


End Sub

many thanks



 
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
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
syntax question - cell references in VB code needyourhelp New Users to Excel 1 March 2nd 05 08:52 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM


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