View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] hglembin@googlemail.com is offline
external usenet poster
 
Posts: 6
Default Confusion Using Named Ranges

Hi All,

I was sure this problem would be in the newsgroups already, but 2 days
of searching and trying various things that seemed applicable =
general confusion.

My data sheet contains about 25 columns and 50 rows of data. I've
created a macro to define a named range for each column using the
header row values for range names. That seems to work well.

The first column contains hull numbers for ships and the rest of the
columns contain dates for various events. Each hull number relates to
a separate sheet that contains additional information about the boat.
I need to be able to update the individual sheets after the main "Date
Summary" sheet is sorted. Users will be able to select any event
column and sort all boats by the dates listed.

When a sheet other than "Date Summary" is activated, i set a variable
"intRw" to the current row on "Date Summary" that contains the date
for that particular sheet (named after hull number). On the sheet for
the individual ship, I'm trying to set formulas for updating the event
dates. This works well using the following line and a "hard"
reference to the column number:

ActiveCell.offset(1,0).Formula = "="+strDS + "G" + strRw
(where strDS="'" + "DATE SUMMARY" + "'" + "!", "G" is column G, and
strRw is string equiv to intRow ref)

I'm trying to eliminate the hard column refs just in case anyone
inserts/deletes a column or two.

Trying to use something like:

ActiveCell.offset(1,0).Formula = "=Range('FullNameValue')"+ "(" +
intRow + ",0)"
(where "FullNameValue" is one of my named ranges)

This line is giving me a "Type mismatch" error. I've also tried to
use a "Cells(x,y)" formula without luck.

I think I am not understanding how to correctly use my named ranges to
identify the correct column. When I tried to use Range
("FullNameValue").Column, I received a "Method 'Range' of object
_global failed" error.

Any guidance would be greatly appreciated.

Respectfully,
hglembin