LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Inserting value with increment by 1 from previous value

I need unique ID in Row 1

How do i modify this code to have value of ( 1+value in column A from 1 row
above ) instead of static 1



Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub

On Error GoTo errHandler:

If Target.Column = 2 And Target.Value < "" Then
Cells(Target.Row, 3).Value = "New"
Cells(Target.Row, 1).Value = 1
Cells(Target.Row, 5).Select
End If

errHandler:
Application.EnableEvents = True

End Sub

I thought that i could search for max in column A and then add 1
Or remember previous value and insert it in variable somehow

how do i best acomplish this task ?
 
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
3-Color Scale Vlookup for Current Month/Previous/Pre-Previous NeoFax Excel Discussion (Misc queries) 2 January 8th 10 07:04 PM
previous post Increment a filename. katagrga Excel Discussion (Misc queries) 0 July 23rd 09 03:46 PM
Inserting a new worksheet that is linked to a previous one Joanne Excel Worksheet Functions 0 December 8th 08 04:04 PM
Inserting new row and pasting formulas from previous row Redsphynx Excel Discussion (Misc queries) 4 May 8th 08 12:44 AM
Can I retain functions from a previous cell when inserting a new r Philobr Excel Discussion (Misc queries) 1 December 3rd 04 10:41 AM


All times are GMT +1. The time now is 07:55 PM.

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"