Using Buttons for tasks

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
96
Office Version
  1. 365
Hi all,

Hopefully the below will make sense.

The table below is a simplified version of what I need.
ABCDF
Task nameStatusStart timeEnd timeDuration
start tasksOpen

Basically what I need are 3 buttons on my excel for Start Task, End Task, Not Required.
When I select cell A2 (Task name) and click the 'Start Task' button, I need cell B2 (Open) to change to say 'In Progress' and fill cell B2 Orange. Also for the current time to be inserted into cell C2.
Whilst in cell A2 and when I select the 'End Task' button I need cell B2 to change to 'Finished', the cell to be filled Green and the text changed to white. The current time to be inserted into D2 and the duration between C2 & D2 to be populated in F2.
Again whilst in cell A2 if I hit the 'Not Required' button i would like B2 to just say 'N/A', B2 to fill red and the text turn white.
So in the above example it will only be row 2 that is affected.

There are going to be multiple rows in this spreadsheet so I need the above to work all the way down the sheet. So if I select A56 it's the other columns in row 56 that change.

Hope this makes sense.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
When I look at this image it looks like:
Task name is in A1 Not A2


And why do I see A B C D F

Is this in range A1 B1 C1 D1 and what happened to E
 
Upvote 0
I would suggest not using buttons.

I think the user double clicks on Range(A2) script runs doing this:
Or if user double clicks on Range(B2) script runs doing this:

So tell me when user double clicks on A2 what do you want to happen.
Show me the script you would have put in the button.
 
Upvote 0
I would suggest not using buttons.

I think the user double clicks on Range(A2) script runs doing this:
Or if user double clicks on Range(B2) script runs doing this:

So tell me when user double clicks on A2 what do you want to happen.
Show me the script you would have put in the button.
Thanks for the answer.

My reason for wanting buttons is that there are 3 options that occur for Cells in Column A. I want to Start Tasks, End tasks or Mark tasks as N/A.

It's A2 onwards.

I highlight Cell A2 and click a button (Start) that will turn cell B2 Orange and change the text in B2 to 'In Progress' and also add the current time in cell C2.

Cell 2 is still highlighted and i click another button (End) which turns cell B2 Green and the text turns white and now says 'Complete'. Cell D2 is populated with the current time and the difference between C2 & D2 is input into F2 in minutes.

Cell 2 is highlighted and I click the 3rd button which changes cell B2 to Red and the text turns white and now says 'N/A'.
 
Upvote 0
OK that's fine:
This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
 
Upvote 0
For the start button how about
VBA Code:
Sub Graham()
   With ActiveCell
      .Offset(, 1).Value = "In Progress"
      .Offset(, 1).Interior.Color = 49407
      .Offset(, 2).Value = Time
   End With
End Sub
 
Upvote 0
Solution
For the start button how about
VBA Code:
Sub Graham()
   With ActiveCell
      .Offset(, 1).Value = "In Progress"
      .Offset(, 1).Interior.Color = 49407
      .Offset(, 2).Value = Time
   End With
End Sub
That works fine. Thanks
 
Upvote 0
Do you need help on the other two codes, or can you modify that code yourself?
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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