Code:
[COLOR=#E56717][FONT=Consolas][B]Sub[/B][/FONT][/COLOR][COLOR=#141414][FONT=Consolas] add()[/FONT][/COLOR]
[COLOR=#151B8D][FONT=Consolas][B]Dim[/B][/FONT][/COLOR][COLOR=#141414][FONT=Consolas] v [/FONT][/COLOR][COLOR=#151B8D][FONT=Consolas][B]As[/B][/FONT][/COLOR][COLOR=#141414][FONT=Consolas] Workbook, cellValue [/FONT][/COLOR][COLOR=#151B8D][FONT=Consolas][B]As [/B][/FONT][/COLOR][COLOR=#F660AB][FONT=Consolas][B]String[/B][/FONT][/COLOR]
[COLOR=#8D38C9][FONT=Consolas][B]With[/B][/FONT][/COLOR][COLOR=#141414][FONT=Consolas] Worksheets([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"Sheet2"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas])[/FONT][/COLOR]
[COLOR=#141414][FONT=Consolas] cellValue = .Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas] & .Cells(.Rows.Count, [/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]).[/FONT][/COLOR][COLOR=#8D38C9][FONT=Consolas][B]End[/B][/FONT][/COLOR][COLOR=#141414][FONT=Consolas](xlUp).Row).Value[/FONT][/COLOR]
[COLOR=#8D38C9][FONT=Consolas][B]End[/B][/FONT][/COLOR][COLOR=#8D38C9][FONT=Consolas][B]With[/B][/FONT][/COLOR]
[COLOR=#141414][FONT=Consolas] ActiveSheet.Range([/FONT][/COLOR][COLOR=#800000][FONT=Consolas]"A1"[/FONT][/COLOR][COLOR=#141414][FONT=Consolas]).Value = Format$((Right$(cellValue, 3) + 1))[/FONT][/COLOR]
[COLOR=#8D38C9][FONT=Consolas][B]End[/B][/FONT][/COLOR][COLOR=#E56717][FONT=Consolas][B]Sub[/B][/FONT][/COLOR]
i m using these codes but there is 1 problem with these codes is that it check last number and increment, can it can also check if any number is missing in between. for example if it is checking number from 1 to 10 and 7 or 4 any number is missing it show that number else it find last number and increment.
Last edited: