Hi

This is driving me nuts. I have a spreadsheet with input values on one sheet. Depending on the value chosen, it will hide/unhide rows on another sheet.

To be "more efficient" I have tried to name ranges in Excel for the cells that hold the input values (because I use this as a template and if I need to change things slightly I don't have to go back into the code to try and find all the references for the input values... so it was supposed to save time... )

But for whatever reason, I can't seem to get the code to even pass the value... tried setting it as Dim i as Range, or Dim i as Interger and neither worked.

I'm sure it's something very small I'm doing wrong.

Original Code (stating exact cell address) - works fine, I just want to change the "Cells(14,3)" for example to the named cell "Life"... Cells(17, 3) is "LTD".....
Dim iLife As Integer
Dim iLTD As Integer
Dim iCash As Integer


'Step 1: Procedure to get variables (cash, ltd and life from input sheet)

iLife = Sheet1.Cells(14, 3)
iLTD = Sheet1.Cells(17, 3)
iCash = Sheet1.Cells(21, 3)

'Step 2: Hide all rows that won't be used. 

Sheet9.Rows("19:64").Hidden = True
Sheet9.Rows("66:111").Hidden = True

'Step 3: Unhide rows based on values of Life, Cash and LTD
'for section A1.1

'Methodology: Select the starting row and unhide it, select the next row and unhide it...
'do this until you've select the number of rows that life, cash, or ltd equals.

'Step 3a: Unhides Life rows (19 through 33 based on life value from input tab).

Count = 0
Do Until Count = Life
Sheet9.Rows("19:19").Offset(Count).Hidden = False
Count = Count + 1
Loop
I get Object Variable or With Block variable not set if I just change to
iLife = Sheet1.Range("Life")
I've tried searching internet etc, can't find similar code... any simple ideas?