Macro to Insert Character Depending on Value Help

avd88

Board Regular
Joined
Jan 18, 2016
Messages
112
Hello,

I am trying to write a code that when I press a button I get an X inserted in the relevant cell. If Z5 = 1 then put an X to AB5 if Z6 = 2 then put an X in AC6 (See Below). Eventually the Periods will change and AB through AE should be all filled out with Xs.

The range is dynamic so somethin like:

Code:
Dim nextrow As Integer

nextrow = WorksheetFunction.CountA(ActiveSheet.Range("T:T"))

qrkpxf.jpg


I appreciate the help.
 
It was not at all clear that you wanted to do that given the picture you posted in Message #5 .
True, but to be fair, it was detailed in the description in that post.

.. so the next month I click on that button the ones that have a 1 will now have a 2 and an X will be inserted into P2, so there will now be an X on P1 and an x on P2, and so on. The ones that started in Period 2 next month will have a blank on P1, and an X on P2 and P3....
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
True, but to be fair, it was detailed in the description in that post.
True, I see that now, but since I roughly "knew" what the OP wanted from his first two messages so I stopped reading after see these first sentences figuring the picture would tell me all I needed to know...
I only have one button, I think this image will explain better what I am trying to accomplish. After I click the DoneButton, this is what column AB to AF should look like.
 
Upvote 0

Forum statistics

Threads
1,223,959
Messages
6,175,649
Members
452,663
Latest member
MEMEH

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