Refer to last non-empty cell in a row

Hermac

New Member
Joined
Sep 5, 2016
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hello,
I'm looking for the fastest VBA reference for the range [H1:X1], whith [X1] being the varying bat furthest non-empty cell to the right of row 1.
I know it's a rather banal question but I can't get it done.
Can anyone give me a hand.
Thanks a lot!
Herman
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I don't understand what you need, could you explain it with examples.
 
Upvote 0
If the cells to the right of X1 are truly empty then maybe try...
VBA Code:
Range("H1", Cells(1, Columns.Count).End(xlToLeft)).Select
The .Select is just for demo purposes
 
Upvote 0
Solution

Forum statistics

Threads
1,221,526
Messages
6,160,338
Members
451,637
Latest member
hvp2262

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