debbiezzzzz
IS-IT--Management
Hello,
I have to write a macro or vba code and add them as buttons on a worksheet for our users. Unfortunately, I really don't know excell VBA. (I've used Access VBA extensively, and VB, but not sure on the objects methods etc for Excel.)
Anyhow what I want to write is basically this...
The sheet is has about 10 colums of info, and one row for each "record". There are for categories of line items that each have their own counter. The ID for each record follows a naming convention. (AAA-001, AAA-002 etc for type AAA, BBB-001, BBB-002 etc. for type BBB and similar for Types CCC and DDD)
What I want to do is have four buttons. Each to ADD a new line for AAA or BBB or CCC or DDD. The macro will need to find the last AAA or BBB or CCC or DDD record and insert a new blank line, Add the new entry (CCC-004 for example) to column A and leave the cursor on Column B for this new record.
If the user accidently sorts by another column, I would maybe have to sort it by column A again first?
Column A might look like this in a typical scenario.
AAA-001
AAA-002
AAA-003
AAA-004
BBB-001
BBB-002
CCC-001
DDD-001
DDD-002
If the User clicks the (Add C record.) I would want a new line below CCC-001 added, and then Column A filled in with CCC-002 automatically.
Anyhow, if anyone can point me in the right direction to get some sample Excel VBA that might help, that would be great.
Thanks,
D
I have to write a macro or vba code and add them as buttons on a worksheet for our users. Unfortunately, I really don't know excell VBA. (I've used Access VBA extensively, and VB, but not sure on the objects methods etc for Excel.)
Anyhow what I want to write is basically this...
The sheet is has about 10 colums of info, and one row for each "record". There are for categories of line items that each have their own counter. The ID for each record follows a naming convention. (AAA-001, AAA-002 etc for type AAA, BBB-001, BBB-002 etc. for type BBB and similar for Types CCC and DDD)
What I want to do is have four buttons. Each to ADD a new line for AAA or BBB or CCC or DDD. The macro will need to find the last AAA or BBB or CCC or DDD record and insert a new blank line, Add the new entry (CCC-004 for example) to column A and leave the cursor on Column B for this new record.
If the user accidently sorts by another column, I would maybe have to sort it by column A again first?
Column A might look like this in a typical scenario.
AAA-001
AAA-002
AAA-003
AAA-004
BBB-001
BBB-002
CCC-001
DDD-001
DDD-002
If the User clicks the (Add C record.) I would want a new line below CCC-001 added, and then Column A filled in with CCC-002 automatically.
Anyhow, if anyone can point me in the right direction to get some sample Excel VBA that might help, that would be great.
Thanks,
D