ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I custom autofiller with VBA (https://www.excelbanter.com/excel-discussion-misc-queries/229806-how-can-i-custom-autofiller-vba.html)

John

How can I custom autofiller with VBA
 
Hi I am John.
I am using 2003 and would like to be able to locate last number in column
"A" copy it and add 1 to it. Example.. 010970 current in lastrow cell A24.
I would like cell A25 to autofill with 010971 when worksheet is opened. I
know this is something simple but being new to excel I am having troubles.
Thanks for all your help!

Dennis Tucker

How can I custom autofiller with VBA
 
Is there any data in column B?

If there is, then you could use a worksheet function to automatically add
the next number into column A.

In cell A2 put

[=if(B1="","",A1+1)] do not include the square brackets[ ].

Then copy and paste cell A2 to many locations under A2(as many as you think
you will need, as many lines of data you are expecting).

This formula looks at the data in the B column in the line above, if it is
blank then nothing will show(in the example cell A2 would be blank if cell
B1 is blank). If there is data in B1, then A2 will show an incremented
value(A1+1).

Hope it helps.


Dennis

"John" wrote in message
...
Hi I am John.
I am using 2003 and would like to be able to locate last number in column
"A" copy it and add 1 to it. Example.. 010970 current in lastrow cell
A24.
I would like cell A25 to autofill with 010971 when worksheet is opened. I
know this is something simple but being new to excel I am having troubles.
Thanks for all your help!




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com