Button click VBA code to insert new row below and include the next number of the task ID.....

cabellos

New Member
Joined
Apr 2, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I'm new to this board and would really appreciate some assistance with a macro code.

I am building a task tracker. Each row has a unique task identifier which starts as 0001 and will continue sequentially. I have 1 row entry complete in row 8 that includes other formulas and lists, conditional formatting etc.

At the top of my form (and ideally without having to click in the current row before) i want to be able to 'add new task' whereby a new row with the the next number in the sequence is inserted below and this row includes all the formulas, drop lists and conditional formatting of the row above.

Any help will be very much appreciated.

PN
 
Hi Again,

I am approaching completion, however I require a bit of support now that I intend to lock the worksheet at the top of the spreadsheet. When I attempt to lock the cell range A6:O6 to prevent editing, the 'Insert New Task' button no longer runs. Please follow the link below to the Dropbox file...

Note that row 7 will remain unlocked as I intend to add filtering functionality.

MY WIP V8.xlsm

Your help would be very much appreciated.
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
By locking do you mean fixing the top portion of the sheet so it does not roll up out of view or do you mean lock so the user cannot click into it?
 
Upvote 0
I should have been clearer. I meant to say locking such that the user cannot click into the top portion.

I seem to have solved this by editing the code such that once clicked, the sheet is momentarily unlocked to execute the insert function and then it protects the sheet again at the end of the code.
 
Upvote 0
that's good. Is it working as you need it to now?
 
Upvote 0
Yes that portion is. I have another unrelated issue and it does appear trivial but for whatever reason I cant figure it out!

I have two date entry columns (column D and column J). However each time I enter the date into the cells the format is autocorrected to US date format. This is despite formatting for UK as DD/MM/YY. Do you have any ideas for this? I was tempted to post a separate thread.

Please follow link to the document:

MY WIP V9.xlsm

Thanks,
 
Upvote 0
I will do some research on this but you might get better help if you start a new thread for this issue.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top