LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Naming a range in a module

I want to select a two cell range and name it using Excel Basic.

The code below does select the two cells with the coordinates of the lower
cell being (ReqRow,ReqCol).

The first two lines of the naming code compile and run but produce nothing
ie no name in list of range names. AccCode is correctly read previously
however. It is a 3 letter string eg veh.

The third line of the naming code will not compile - how do you name a range
rather than a single cell?

Help! There is so much I don't know!

Sue

ReqRow = ActiveCell.Row
ReqCol = ActiveCell.Column
ActiveCell.Offset(-1, 0).Range("A1:A2").Select
ActiveWorkbook.Names.Add Name:="ac" & AccCode, RefersToR1C1:= _
"'Work Data'!R[" & ReqRow & "]C[" & ReqCol & "]:" _
'Comment [" & ReqRow & - 1"]C[" & ReqCol & "]""
ActiveCell.Offset(1, 2).Range("A1").Select
 
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
Range naming Squeaky Excel Discussion (Misc queries) 2 December 29th 06 09:10 PM
Module naming Dan Excel Programming 1 May 31st 06 05:33 PM
Naming a range bob777 Excel Discussion (Misc queries) 1 February 1st 06 01:05 PM
naming a range Jo[_6_] Excel Programming 2 June 24th 04 09:39 PM
VB Code Naming a Range (range changes each time) krazylain Excel Programming 4 May 15th 04 12:41 PM


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