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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,388
Office Version
  1. 365
Platform
  1. Windows
Did you try unhiding your range, then running the macro (or using the macro to unhide the range)?
 

ecarney14

New Member
Joined
Sep 21, 2006
Messages
42
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
 

Forum statistics

Threads
1,137,193
Messages
5,680,082
Members
419,879
Latest member
jzl

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
Top