Random Color Msgbox / Userform
Apr 13, 2014
Is there a way to change the color of a msgbox? My option then appears to build a userform that basically does the same thing but allows me color selection.
Why is this important? I have a quasi-legal disclaimer that pops up every time the workbook is opened the first time (via a template). My boss has commented that after the first couple of times folks just blow through it without reading it (which is a fair comment).
My thoughts are to randomly change the color every time it opens, hoping that it might catch their attention. How do you control the text color to make sure it stays readable?
View 3 Replies
ADVERTISEMENT
Jun 9, 2014
I would like a sub (Like a Private Sub) that would automatically activate when certain text is pasted into the sheet.
Data is pasted to this spreadsheet starting on row 27 and can be several hundred rows of data.
Column O (15) is for Abbreviated States i.e. TX, ID, WA, etc.
If in column O "PR" is pasted then ...
1. Msgbox ("Alert")
2. Color the cell - Interior.ColorIndex = 46 'Orange
View 5 Replies
View Related
Mar 11, 2009
If there are any cells highlighted in red (using the conditional formatting in excel 2003), I want a message box to pop up when they go to save saying something along the lines of, "Hey buddy, you really need to deal with this."
View 9 Replies
View Related
Feb 6, 2014
I want to return to the userform if the msgbox occurres (then a text / listbox is empty) so the textbox can be filled before populating the data to the worksheet.
View 11 Replies
View Related
Oct 12, 2008
I have a userform for inputing a range of vehicle details. It will not let the user add the details unless all fields are complete.
If the user complets some of the fields and closes the form it will not save any information.
They must use a command button to close the form (the red X will not show)
I am looking for a way for a warning msg box to appear when they select the close form button
View 6 Replies
View Related
Mar 21, 2009
I have set up a userform. I have alot of if statements to help the user input correctly. The first part of the code is fine, it's just to show you what i'm doing. The part in red shows where i have no idea how to write it.
There is a value in worksheet 'day 1 grade 2'!h31, if the value is equal to or greater than 30 and a value has been entered into Me.NoOfStudents.Value, i want the msgbox the appear.
View 3 Replies
View Related
Feb 21, 2013
I am currently using a bunch of msgboxes to tell the user if a specific error has occurred. I want to get rid of the ugly gray box and customize my own. I am having problems setting up the code as I would like it to function like msgbox does where I can supply a header and message string and then it displays in the userform. I tried coding it kind of how I would pass variables to a function and it doesn't seem to work.
Userform:
Code:
Private Sub userform_initialize(msg As String, hdr As String)
MessageBox.Caption = msg
myMessageBox.Caption = hdr
End Sub
Sub:
Code:
Call myMessageBox("Hi", "hi")
View 4 Replies
View Related
Feb 18, 2013
The macro below will select a random cell, I would like to add a color (green) to the selected cell and add NO/CANCEL to msgbox, when NO is selected it will continue selecting random cell and CANCEL exit sub.
[Code] .....
View 5 Replies
View Related
Apr 11, 2008
I have got a userform with lots of controls,
One of the action's on a large group of the controls is the same but except for one number
here is an example
If TextBox107.ForeColor = 255 Then ActiveCell. Offset(0, 53).Font.ColorIndex = 3
If TextBox108.ForeColor = 255 Then ActiveCell.Offset(0, 54).Font.ColorIndex = 3
If TextBox109.ForeColor = 255 Then ActiveCell.Offset(0, 55).Font.ColorIndex = 3
This makes a cell that correlates to the textbox red if the text in the textbox is red.
Now, I loads of these textboxes that all need to run the same code with just the Offset value one digit higher than the last and I was hoping I could create a loop to avoid a huge block of code but I can't work out how to make a constant that will +1 with each loop.
Also, can I assume that a loop will start with the control with the lowest number i.e. Textbox1 and then work its way through the rest of them in order?
View 3 Replies
View Related
Feb 5, 2009
I am wondering, in excel 2003 is it possible to randomly select two numbers from one column, say column b9:b45, that are random numbers, and selected by two different font colors. In other words: b9=1348, b10=1349, b11=1350, b12=1351, b13=1352, b14=1353.
Say we press a macro button, and in field B50 one radom black colored number is selected of a field of say 30 numbers that are all black in that column, and in b51, one red number is selected, in a field of 30 red numbers. We want to used this macro to select winners simulating a raffle drawing.
View 4 Replies
View Related
May 29, 2013
I'm trying to create a dynamic msgbox that will display what data has been updated based on checkbox selections in the userform. I've named my checkboxes as Carey, Keith, and Juliet.
Ideally if only Carey's data has been updated, I'd like the msgbox to say
' Data has been Updated for:
- Carey '
If Carey and Keith's data has been updated, I'd like the msgbox to say
'Data has been Updated for:
- Carey
- Keith '
etc.
MsgBox ("Data has been Updated for:" & vbnewline & _
If CAREY.Value =true then "- Carey" End if & vbnewline & _
If KEITH.Value =true then "- KEITH" End if & vbnewline & _
If JULIET.Value =true then "- Juliet" End if & ")
View 3 Replies
View Related
Apr 24, 2009
I have 2 UserForms at the moment. They only serve as a sort of welcome screen when you open the xls file. I have this code to open the Userform.
View 14 Replies
View Related
Jan 28, 2008
I have developed some VBA code which produces a 'lucky number' using the RND function. The final number is produced by concatenating three individually generated random numbers between zero and 9. When the code is written in a Module, I can display each number as it is generated, by 'pausing' the macro with a For Next loop.
I have now developed a similar application using a MultiPage Userform, but the individual numbers are not displayed when I use exactly the same code. The only way I have found to display each number as it is generated is to use
Application.Wait
However the shortest wait time seems to be 1 second, which is too long. I would like to be able to make the MultiPage version look like the Module version.
I attach a workbook which shows both of the above.
View 3 Replies
View Related
Apr 17, 2014
I have a userform with a command button which fires a macro.
everything works fine so far.
my problem is:
I would like to add a msgbox at the end of the macro which confirmes "successfully completed".
I cannnot simply add the msgbox at the end of the macro. don't know what I'm doing wrong.
(see below)
Private Sub CommandButtonOK_Click().
If Me.OptionButton1.Value = True Then
ThisWorkbook.Worksheets("PropertyWorksheet").Range("A1").Value = "Government Securities"
ElseIf Me.OptionButton2.Value = True Then
ThisWorkbook.Worksheets("PropertyWorksheet").Range("A1").Value = "Corporate Bonds"
[Code].....
Unload Me
Application.ScreenUpdating = False
Sheets("MySheet1").Select
Application.ScreenUpdating = False
'run macro
MyMacro1 (adds, hides and deletes various sheets)
MyMacro2
[Code]....
View 2 Replies
View Related
Oct 31, 2006
is there ant way to clearly highlight command buttons on a userform that the program user selected (clicked on) ie change its clour or raise it etc so the user can easly see which button they have clicked on.
View 3 Replies
View Related
Feb 25, 2008
I have created a userform for the purpose of inputting data into a database, now one of the people who uses it wants me to make it so certain cells will be in a different colour if a button is selected, I can use this code to make the textbox change colour
Me.TextBox1.ForeColor = &H8000000D
but when I have the data in the textbox transfer to a cell in excel any colour change is lost, is there any way to get around this,
View 9 Replies
View Related
Sep 18, 2009
I am working on a Random Cycle Count Generator that provides random SKU#s based on 3 separate columns of SKU listings. The user clicks a button to generate the SKU#s to cycle count for that day. What I would like to see is a date stamp in the columns next(B,D,F) to the referenced SKU listing(A,C,E) based on which SKU#s are generated. This will let me see the last date that the SKU was generated. I would also like it to automatically save after generating.
View 2 Replies
View Related
Mar 11, 2009
I have a UserForm and what I'm trying too do is change the color property of all the labels on the form simultaneously.
View 9 Replies
View Related
Aug 8, 2012
I am trying to use VBA in Excel 2007 to change bar chart series colors. I have found a few posts that link it to a cell background, but I'm struggling to find one that does the font color.
It would be great if I could change the bar chart series to match the color of the text in the A column, so that if I highlighted the value in A1 and changed the text color to orange for whatever reason, the chart updates the value of 1.2 to an orange bar (see below).
T. A1 B1
Sample 1 1.2
Sample 2 2.1
Sample 3 1.7
Sample 4 5.6
View 3 Replies
View Related
Aug 31, 2012
I have a range of cells that change colors with conditional formats based on the cell value from high to low. I would like to link the cell color to an object such as a circle or rectangle. When the cell value changes along with the conditional format, the color of the object will also change.
View 3 Replies
View Related
Jan 15, 2009
I wrote a macro to color the cell values in the rows based on their average value. For eg if the cell value is less than 0.2 Avg, they should be red color,if value is between 0.2 and 0.5 it should be yellow. This part is working fine
Now based on the color of the rows cells , need to write a macro for the header one. Logic is Coloum header should be in red colour, if in one or more number of rows cells are red. same with yellow ones. Could you please help me out in solving this with logic.
View 8 Replies
View Related
Oct 27, 2009
I have attached the relevant spreadsheet for which I need to alter the color of the columns based on Site number ( Sheet 1). % Mortality will be represented in the Y-Axis, and the Site numbers would be on the X-Axis. All columns (% Mortality) except one will be of the same color, and the one of a different color will indicate a specific site. As an example, site 86 is colored differently. The way I require the chart to look is shown on Sheet 1.
After reading through some great posts on Ozgrid, I managed to do this using conditional formatting (Sheet 2), but that sort of falls short because I am required to add a data table to the chart, and the parameter that is indicated by the column bars happens to appear twice in the data table.
I was wondering if this can be automated maybe using VBA, but with the possibility of simply matching the color of columns with the font color of respective entry in the data series.
View 9 Replies
View Related
Nov 2, 2008
I'm trying to add a textbox at the current position (selected cell) with a set size, fill color, and border color. I found this: http://msdn.microsoft.com/en-us/libr...8(VS.80).aspx:
View 2 Replies
View Related
Aug 19, 2009
how I can alternate the background color (fill color) of rows in a spreadsheet. Say I wanted every other row to be gray starting at row 10.
View 6 Replies
View Related
Oct 22, 2009
In my Excel 2003 worksheet, I need the row color to automatically change to blue (color 5) (bgcolor = #0000FF) - when the user changes the text from VALID to INVALID in the range: B3:B65000.
For example:
Cell B5 contains the text: VALID
When the user changes the text in the field to read: INVALID - then I need the row range: A5:W5 to change to the color blue.
View 4 Replies
View Related
Nov 1, 2009
This is probably elementary, but I'm struggling and would appreciate any help as I have very little excel VBA experience to draw from.
I have assembled code which changes the cell color based on a value change in Column A. Column A will contain many different groups of repeating values. This code works well and and I have been able to figure out how to limit the number of colors to only 2. The end result is each set of similar values in column A is visually grouped by one of two alternating colors.
The number rows in the data set is variable as the data set is extracted from SAP. The number of columns is fixed.
What I want to do now is set the cell color in columns B through F the same color that was assigned to the row in column A. So if cell A3 is set to colorindex = 6, then I want to set the range of cells B3 to E3 to the same color.
Here is the code I am using to set the color of the cells in Column A:
View 7 Replies
View Related
Feb 15, 2010
I would like to be able to change the color of a cell in V4:AB31 and have the formula in AM10:AM13 automatically calculate the new result. As it is now the user has to press Ctrl ALT f9 for the formula to recalculate.
View 7 Replies
View Related
Apr 18, 2008
I have two columns. The first one (A) contains cells that have different Fill colors. The second column (B) contains text adjacent to the colored cells. I am trying to change the color of the text in the second column (B) to the corresponding color in the adjacent cell in the first column (A). I don't think conditional formating works well in this situation. I believe the solution would be some sort of macro.
View 3 Replies
View Related
Jul 31, 2014
i have been trying to add msgbox to show that if textbox1 and textbox3 are empty than show "please enter i.d or lockern no but if textbox3 is true than run the code or textbox1 is true than run the code.
View 1 Replies
View Related
Apr 18, 2007
For some reason the fill color and font color no longer work! If I set the font color as red, it continues to show up as black!
This is the strangest thing! I have no conditional formatting set and this just started a week ago.
View 14 Replies
View Related