Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create Named Range in VBA


I would like to highlight a range of cells in my worksheet and then ru
a macro that will then create a Named Range using those highlighte
cells.

I suppose the VBA would be something like:
ThisWorkbook.Names.Add Name:="NewName", _
RefersTo:=

But I don't know what code is needed next. Can anyone help?

Many Thanks,
Michae

--
michael.a
-----------------------------------------------------------------------
michael.a7's Profile: http://www.excelforum.com/member.php...fo&userid=3302
View this thread: http://www.excelforum.com/showthread.php?threadid=55014

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Create Named Range in VBA

Hi Michael,

Try:

'=============
Public Sub Tester()
Selection.Name = "YourName"
End Sub
'<<=============


---
Regards,
Norman


"michael.a7" wrote
in message ...

I would like to highlight a range of cells in my worksheet and then run
a macro that will then create a Named Range using those highlighted
cells.

I suppose the VBA would be something like:
ThisWorkbook.Names.Add Name:="NewName", _
RefersTo:=

But I don't know what code is needed next. Can anyone help?

Many Thanks,
Michael


--
michael.a7
------------------------------------------------------------------------
michael.a7's Profile:
http://www.excelforum.com/member.php...o&userid=33027
View this thread: http://www.excelforum.com/showthread...hreadid=550149



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create Named Range in VBA


Thanks Norman :)


--
michael.a7
------------------------------------------------------------------------
michael.a7's Profile: http://www.excelforum.com/member.php...o&userid=33027
View this thread: http://www.excelforum.com/showthread...hreadid=550149

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
How to create a dynamic named range? Sunita Excel Discussion (Misc queries) 3 March 28th 08 07:47 PM
Create named range Matee Excel Programming 1 April 4th 06 03:40 AM
create named range specific to worksheet [email protected] Excel Programming 2 June 28th 05 04:38 PM
Create a Named Range in Excel with VBA GoKingBee Excel Programming 2 December 7th 04 08:13 PM
Create named range Robert[_16_] Excel Programming 2 October 27th 03 11:57 PM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"