#1   Report Post  
Anthony
 
Posts: n/a
Default worksheet question

Hi,
I am quite new to this so go easy !,
I have the code (donted - thanks) below that will create a new worksheet
with the name changed to some data input by the user.
my question is it possible to 'format' parts of this worksheet ie show data
in cell B13 as 'bold' and to add three 'heading's to 3 different cells.
so by default I want the newly created worksheet to have the following
'standard' settings.
cells D13:D17 and F13:F17 to be formatted to show values in £
cell D12 to show the word "PRICE" in bold size 12
cell B25 to be text size 20 in colour red and also bold.

is this possible - if so how??
oh yes here is the code I have

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 many thanks

  #2   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Anthony,

Although the code could put all the stuff in the sheet, you could also just
make a sheet to use as a basis, and copy it when you need a new one. That
way, when you change the layout (or formatting, or whatever) of the sheet,
as you will, mark my words, you won't have to change a bunch of code. You
could hide the sheet.

Sub NewInvoice()
Sheets("Invoice master").Visible = True
Sheets("Invoice Master").Copy After:=ActiveSheet
'ActiveSheet.Name =
Sheets("Invoice Master").Visible = False
--
Earl Kiosterud
www.smokeylake.com/
-------------------------------------------

"Anthony" wrote in message
...
Hi,
I am quite new to this so go easy !,
I have the code (donted - thanks) below that will create a new worksheet
with the name changed to some data input by the user.
my question is it possible to 'format' parts of this worksheet ie show
data
in cell B13 as 'bold' and to add three 'heading's to 3 different cells.
so by default I want the newly created worksheet to have the following
'standard' settings.
cells D13:D17 and F13:F17 to be formatted to show values in £
cell D12 to show the word "PRICE" in bold size 12
cell B25 to be text size 20 in colour red and also bold.

is this possible - if so how??
oh yes here is the code I have

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 many thanks



  #3   Report Post  
Anthony
 
Posts: n/a
Default

Earl,thanks for ur reply,but not sure if I follow.
where do I put this code?? do I add to to the one I have ....
sorry to sound dumb but I did warn you I was new to this
thanks

"Earl Kiosterud" wrote:

Anthony,

Although the code could put all the stuff in the sheet, you could also just
make a sheet to use as a basis, and copy it when you need a new one. That
way, when you change the layout (or formatting, or whatever) of the sheet,
as you will, mark my words, you won't have to change a bunch of code. You
could hide the sheet.

Sub NewInvoice()
Sheets("Invoice master").Visible = True
Sheets("Invoice Master").Copy After:=ActiveSheet
'ActiveSheet.Name =
Sheets("Invoice Master").Visible = False
--
Earl Kiosterud
www.smokeylake.com/
-------------------------------------------

"Anthony" wrote in message
...
Hi,
I am quite new to this so go easy !,
I have the code (donted - thanks) below that will create a new worksheet
with the name changed to some data input by the user.
my question is it possible to 'format' parts of this worksheet ie show
data
in cell B13 as 'bold' and to add three 'heading's to 3 different cells.
so by default I want the newly created worksheet to have the following
'standard' settings.
cells D13:D17 and F13:F17 to be formatted to show values in £
cell D12 to show the word "PRICE" in bold size 12
cell B25 to be text size 20 in colour red and also bold.

is this possible - if so how??
oh yes here is the code I have

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 many thanks




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
Linking cells in a worksheet to other worksheets in a workbook Dave Excel Discussion (Misc queries) 4 June 24th 05 06:18 PM
Macro to search for and display data in another worksheet Mark H Excel Worksheet Functions 0 June 14th 05 12:40 PM
Question about sorting in protected worksheet SJC Excel Worksheet Functions 6 March 24th 05 10:35 PM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM
Indirect reference from one worksheet to another Bill Sturdevant Excel Worksheet Functions 2 December 17th 04 01:23 PM


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