Cannot Jump to Range because it is hidden

ecarney14

New Member
Joined
Sep 21, 2006
Messages
42
I keep getting an error, and I think it is due to 'cannot jump to 'range' because it is hidden...

Any help would be fantastic!


Sub help()

Dim iMax As Double, iMin As Double, lRowMax As Long, lRowMin As Long

iMax = Application.WorksheetFunction.Max(Range("D2:D20000"))
lRowMax = Range("D2:D20000").Find(iMax).Row
iMin = Application.WorksheetFunction.Min(Range("D2" & ":D" & lRowMax - 1))
lRowMin = Range("D2:D20000").Find(iMin, Range("D20000")).Row

Dim rAZ As Range

For Each rAY In Range("D" & lRowMin + 1 & ":D20000")
rAZ.Offset(, 48) = rAY - iMin
Next
End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Did you try unhiding your range, then running the macro (or using the macro to unhide the range)?
 
Upvote 0
Yeah, I tried that. I didn't know if it has something to do with the fact I use a different range to find the iMin? Because basically I was using the values before the iMax to find the imin. So technically I could use the same range, but it isn't working for some reason.

Thanks for your help
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,039
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top