Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Naming cells using VBA

I'm very new to creating VBA code so what I would like help with is this
problem. I'm trying to create a name for a cell that incorporates another
cell contents and the words "Grand_Total_".

My thoughts are along the lines of trying to develop code that creates the
new name that I want (e.g Grand_Total_Bandage) by joining the cell with the
contents of 'Bandage' to the words "Grand_Total_" and then use this for the
cell name. What I can't work out is how to reference the contents of the
cell I want and then add it to the Grand_Total_. I'm pretty sure I know how
to add the results to the other cell that I want to name using VBA code.

Any assistance would be most appreciated.

Insp G


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Naming cells using VBA

Hi Gadget,

Try something like:

'=============
Public Sub Tester()
Const sStr As String = "Grand_Total_"

Range("A1").Name = sStr & Range("B1").Value
End Sub
'<<=============


---
Regards,
Norman



"Inspector Gadget " <oakey**<<REMOVE wrote in message
...
I'm very new to creating VBA code so what I would like help with is this
problem. I'm trying to create a name for a cell that incorporates another
cell contents and the words "Grand_Total_".

My thoughts are along the lines of trying to develop code that creates the
new name that I want (e.g Grand_Total_Bandage) by joining the cell with
the
contents of 'Bandage' to the words "Grand_Total_" and then use this for
the
cell name. What I can't work out is how to reference the contents of the
cell I want and then add it to the Grand_Total_. I'm pretty sure I know
how
to add the results to the other cell that I want to name using VBA code.

Any assistance would be most appreciated.

Insp G




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Naming cells using VBA

Thanks for the tip I'll give it a go.

"Norman Jones" wrote in message
...
Hi Gadget,

Try something like:

'=============
Public Sub Tester()
Const sStr As String = "Grand_Total_"

Range("A1").Name = sStr & Range("B1").Value
End Sub
'<<=============


---
Regards,
Norman



"Inspector Gadget " <oakey**<<REMOVE wrote in message
...
I'm very new to creating VBA code so what I would like help with is this
problem. I'm trying to create a name for a cell that incorporates

another
cell contents and the words "Grand_Total_".

My thoughts are along the lines of trying to develop code that creates

the
new name that I want (e.g Grand_Total_Bandage) by joining the cell with
the
contents of 'Bandage' to the words "Grand_Total_" and then use this for
the
cell name. What I can't work out is how to reference the contents of the
cell I want and then add it to the Grand_Total_. I'm pretty sure I know
how
to add the results to the other cell that I want to name using VBA code.

Any assistance would be most appreciated.

Insp G






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
naming cells ranswert Excel Worksheet Functions 7 November 1st 08 08:44 PM
Range naming cells with blank cells through coding Naveen J V Excel Discussion (Misc queries) 1 March 27th 08 01:46 PM
naming cells Mike C Excel Discussion (Misc queries) 3 April 20th 07 12:58 AM
naming cells Dave Excel Discussion (Misc queries) 2 September 6th 06 09:00 PM
Re-Naming cells Keith Excel Worksheet Functions 1 March 7th 05 03:21 AM


All times are GMT +1. The time now is 08:12 PM.

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"