View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
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