[VBA] how to detect empty cells with hidden formatting etc that usedrange will detect?

excellol

New Member
Joined
May 5, 2020
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
sometimes the usedrange.select returns an empty cell even though the data ended on the previous row. google results mentioned that there is some hidden formatting that is not easily detected.

i find that this happens when i run a macro that inputs values into cells and i subsequently delete the newly inputted data manually using the delete key

is there a vba code that will detect these hidden formatting and alert the user?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I usually don't worry about that and simply calculate the last row and column displaying "something" and use them to control what my code processes (these code lines ignore formulas returning the empty text string "")...

LastUsedRow = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row

LastUsedCol = Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
 
Upvote 0

Forum statistics

Threads
1,212,933
Messages
6,110,752
Members
448,295
Latest member
Uzair Tahir Khan

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