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

andydtaylor

Active Member
Joined
Feb 15, 2007
Messages
355
Office Version
  1. 2010
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
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

andydtaylor

Active Member
Joined
Feb 15, 2007
Messages
355
Office Version
  1. 2010
Sorted!

=OFFSET(END_OF_DAY_FILE!A1,COUNT(END_OF_DAY_FILE!A:A),0)+1
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
No need for a macro:

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

Watch MrExcel Video

Forum statistics

Threads
1,122,668
Messages
5,597,463
Members
414,145
Latest member
lonnie451

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
Top