#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Defining Range Name

Hi All,

One more problem...

I am defining the range name in the column F after counting the number
of data items in Column F starting from F2 (stored in Count1). I am
using this code:


Range("F2").Select
Cells(2, "F").Resize(Count1, 1).Select
ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:="=List!
R2C6:R11C6"

However, looks like the refers to column is static and always naming
F2:F11 range no matter what the count is...IS there any way I can
include Count1 Variable in the "Refers to" part as well

Thanks in advance,
Anshuman

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Defining Range Name

Hi Anshuman,

If I have interpreted correctly what you are trying to do then try this and
see if it works for you:-

Range("F2").Select
Cells(2, "F").Resize(Count1, 1).Select
ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:=Selection

You can replace the range with selection because you have selected it in the
previous line of code.

Regards,

OssieMac


"anshu" wrote:

Hi All,

One more problem...

I am defining the range name in the column F after counting the number
of data items in Column F starting from F2 (stored in Count1). I am
using this code:


Range("F2").Select
Cells(2, "F").Resize(Count1, 1).Select
ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:="=List!
R2C6:R11C6"

However, looks like the refers to column is static and always naming
F2:F11 range no matter what the count is...IS there any way I can
include Count1 Variable in the "Refers to" part as well

Thanks in advance,
Anshuman


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Defining Range Name

Perfect OssieMac.....Thanks a lot

On Jul 22, 1:50 pm, OssieMac
wrote:
Hi Anshuman,

If I have interpreted correctly what you are trying to do then try this and
see if it works for you:-

Range("F2").Select
Cells(2, "F").Resize(Count1, 1).Select
ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:=Selection

You can replace the range with selection because you have selected it in the
previous line of code.

Regards,

OssieMac

"anshu" wrote:
Hi All,


One more problem...


I am defining the range name in the column F after counting the number
of data items in Column F starting from F2 (stored in Count1). I am
using this code:


Range("F2").Select
Cells(2, "F").Resize(Count1, 1).Select
ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:="=List!
R2C6:R11C6"


However, looks like the refers to column is static and always naming
F2:F11 range no matter what the count is...IS there any way I can
include Count1 Variable in the "Refers to" part as well


Thanks in advance,
Anshuman



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
help defining dynamic range joecrabtree Charts and Charting in Excel 0 December 6th 06 03:33 PM
Defining Range within Specific Dates Cardan Excel Worksheet Functions 0 July 26th 06 08:17 PM
Defining a range using a cell reference jagbabbra Excel Worksheet Functions 5 June 5th 06 01:36 PM
Drop down defining content of a range of cells philm13 Links and Linking in Excel 5 March 25th 05 03:31 PM
Defining a range Don Excel Worksheet Functions 1 February 25th 05 03:54 PM


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

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"