Forum Home
Press F1
 
Thread ID: 8133 2001-03-07 00:57:00 Excel97 vbasic Guest (0) Press F1
Post ID Timestamp Content User
9672 2001-03-07 00:57:00 I would like to use a VB macro to apply a name to the active cell in a spreadsheet. I can't get beyond the point of <RefersToR1C1:='=Tasks!R13C2'>. What is the syntax to tell RefersToR1C1 to use the active cell, rather than a specific cell? Here's my current, simple macro:

Application.Goto Reference:='todobase'
ActiveWorkbook.Names('next').Delete
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range('A1').Select
ActiveWorkbook.Names.Add Name:='next', RefersToR1C1:='=Tasks!R13C2'

When I wrote the macro, R13C2 was the cell I wanted, but it might not be!

Thanks,

Steve
Guest (0)
9673 2001-03-07 20:13:00 It seems Excel will not input a range name from VB for an indirect cell reference.
As your macro will always find the first blank cell, is it necessary to also give it a range name?
Guest (0)
9674 2001-03-07 20:36:00 Thanks, Russell,
The purpose of the macro is to use the name as a 'goto' using hyperlinks in the sheet. Each page has a hyperlink, linked to the cell called 'next'. It's only a fancy addition to something that can, to be honest, simply go to the correct page. I have a feeling I can do this as an Excel4 macro, but I'd like to move along!
Steve
Guest (0)
1