Xlup question

yxz152830

Active Member
Joined
Oct 6, 2021
Messages
393
Office Version
  1. 365
Platform
  1. Windows
Gurus,
when i turn a table to a range and try xlup, the cell selection stops at the last non blank cell.
However when I turn a table from external data source, in my case from PDF, to a range, and do xlup the cell selection stops at the cell at the last row regardless. So how come there's this minor difference? BTW if I alt h e a the blank cell it still does the same thing. I need to know the root cause for doing some macro recording. Thanks in advance!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
the cell selection stops at the last non blank cell.
It actually stops a the last empty cell. When you copy from an external source there might be some blank cells at the end which are not actually empty but contain null strings.
To find the last non blank which may not be empty, you would need to use this method instead.
VBA Code:
Set rng = Range("A:A").Find("?*", , xlFormulas, xlWhole, , xlPrevious, False, False, False)
 
Upvote 0
What are null strings and how do I put null strings in a cell?
the code you wrote gave me the last "visually non blank " cell.
It actually stops a the last empty cell. When you copy from an external source there might be some blank cells at the end which are not actually empty but contain null strings.
To find the last non blank which may not be empty, you would need to use this method instead.
VBA Code:
Set rng = Range("A:A").Find("?*", , xlFormulas, xlWhole, , xlPrevious, False, False, False)
do
 
Upvote 0
What are null strings and how do I put null strings in a cell?
They are padding that makes an empty cell appear occupied, among other ways you can put them in cells by using .Value = vbNullstring or by converting formulas that show blanks to values.
the code you wrote gave me the last "visually non blank " cell.
That is correct.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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