I am trying to name a cell that will be referenced in a formulas using name manager via VBA. I have VBA locate the correct cell on the sheet (the location of which will vary) and define it as a variable:
s3form = Range(prog_beg3).Offset(0, 3)
I then name the cell using the name manager functionality so that the cell has the address of 's3form' but with the row being variable. So if 's3form = B5', the address of the named cell would be '$B5'.
ActiveWorkbook.Names.Add Name:=s3_form, RefersTo:=s3form
However, the formula then doesn't recognize s3form as a cell. It seems to only recognize the cell when 's3form = $B$5'
Does anyone have a possible solution?
Thanks
Set:Set s3form = Range(prog_beg3).Offset(0, 3)Of courses3formmust be declared as a range. ThenRefersTo:=s3form.Address- Scott CranerRange(prog_end2).Offset(4, 0).Select prog_beg3 = Selection.Address(RowAbsolute:=False, ColumnAbsolute:=False)s3form = Sheets("testmode").Range(prog_beg3).Offset(0, 3).Address(RowAbsolute:=False, ColumnAbsolute:=True)ActiveWorkbook.Names.Add Name:=sform, RefersTo:=s3form.Address- A.Nelson