A2, Sheet 2 = last cell in Column A sheet 1 plus 1.

andydtaylor

Active Member
Joined
Feb 15, 2007
Messages
360
Office Version
  1. 2016
Hi,

I had a go and this - but it doesn't work! Not really sure why. Please can you suggest what I should be writing to make this work?

Thanks,

Andrew

Sub SUR_Add_One()

Sheets("End_OF_DAY_FILE").Select

Dim last_number As Long
Dim next_number As Long
Set last_number = _
Range("A65536").End(xlUp).Select
next_number = last_number + 1

Sheets("START_OF_DAY_FILE").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = next_number

End Sub
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
No need for a macro:

=LOOKUP(9.99999999999999E+307,End_OF_DAY_FILE!A:A)+1
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,706
Members
449,118
Latest member
MichealRed

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