VBA xltoright, end xldown

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I need to select a range of data from row 5 to the end of the number of columns, then the end of the number of rows.

I've used this, but get a Compile error.

Range("A1", Range("A1").End(xlToRight).End(xlDown).Select

Can someone please point out where I've gone wrong?

Thanks in advance
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Actually, I found this, which does the trick:

(I'm going from cell B5 in the actual data).

Range("b5", Range("b5").End(xlDown).End(xlToRight)).Select
 
Upvote 0
You are missing a closing bracket
Code:
Range("A1", Range("A1").End(xlToRight).End(xlDown)).Select
 
Upvote 0

Forum statistics

Threads
1,215,393
Messages
6,124,680
Members
449,180
Latest member
kfhw720

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