Record Macro for variable array

SimonHughes

Active Member
Joined
Sep 16, 2009
Messages
452
Office Version
  1. 365
Platform
  1. Windows
I need to format a data array which is fixed in width (columns A:X) but variable in length so the array could be A1:X5 or A1:X1000 or whatever.
How do I record a macro (I cannot do VBA) that will place the cursor in column A at the last row in the array?

Any help gratefully received. I am using Excel 365
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi,

To be tested
VBA Code:
Sub Test()
Application.Goto Cells(ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row, 1)
End Sub
 
Upvote 0
Solution
I need to format a data array which is fixed in width (columns A:X) but variable in length so the array could be A1:X5 or A1:X1000 or whatever.
How do I record a macro (I cannot do VBA) that will place the cursor in column A at the last row in the array?

Any help gratefully received. I am using Excel 365
You should be able to use the shortcut keys CTRL + Down Arrow to go to the bottom Row of a column and CTRL + Right Arrow to go to the last Column in the Row.
Another thing you may want to try when recording your macros is to turn on Relative References on the Developer tab to compare the differences.

1675151780204.png
 
Upvote 1

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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