Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 83
Default macro to generate next number

On Tue, 9 Mar 2010 13:26:01 -0800, Mike H
wrote:

A macro it is then

Sub Sonic()
Dim LastRow As Long
Set SrcSht = Sheets("Sheet2")
Set DstSht = Sheets("Sheet1")
LastRow = SrcSht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
DstSht.Range("A1").Value = SrcSht.Range("A" & LastRow)
End Sub


+1 should be added at the end of the last statement like this:

DstSht.Range("A1").Value = SrcSht.Range("A" & LastRow) + 1

Lars-Åke
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
generate different number Paul Excel Worksheet Functions 2 October 6th 08 08:39 AM
Serial number generate Tony Excel Worksheet Functions 4 October 20th 07 04:59 AM
generate a random number and use if function to generate new data Dogdoc1142 Excel Worksheet Functions 4 April 26th 06 03:44 AM
how can text be set up to generate a number? jwmaes New Users to Excel 3 January 25th 05 01:32 PM
generate serial number john douglass Excel Worksheet Functions 0 November 5th 04 10:49 PM


All times are GMT +1. The time now is 08:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"