Question about Inputbox Appearance

frank_AL

Active Member
Joined
Oct 30, 2015
Messages
469
I have code that prompts the user for current month using Inbox. I pre-populate that field before calling the code. The issue I'm having is that Inbox displays are rather small (don't want to create a UserForm!) and the pre-populated number is highlighted which make it harder to read, see image below. Is there a way to change that to where the number '9' is not highlighted?

Let me know, thanks!
1728569729975.png
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Unfortunately this is how the inputboxes are designed, to make it easier for the user to avoid extra step of erasing the default value. I know you dont want to create it but I think UserForm seems to be the only option.
 
Upvote 0
Is there a way to change that to where the number '9' is not highlighted?

Hi
you have not shared your code but using SendKeys with the InputBox Function hopefully, should move cursor to the end doing what you want - maybe?

VBA Code:
     ReportMonth = Month(Date)

    SendKeys "{END}"
    report = InputBox("Enter Current Report Month (Numeric)", "Report Month", ReportMonth)

'rest of code

Dave
 
Upvote 0
Dave,
The concept of your reply makes sense. However, I've tried several different ways to integrate SendKey with the InputBox to no avail. I guess I need to create a UserForm. Thanks for your reply.
 
Upvote 0
Dave,
The concept of your reply makes sense. However, I've tried several different ways to integrate SendKey with the InputBox to no avail. I guess I need to create a UserForm. Thanks for your reply.

As said, as you never shared any code so I just created an example - concept normally works ok in other applications I have assisted with but perhaps not for your requirement.

Appreciate your feedback

Dave
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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