I want to have the top half of the userform colored in Red and the bottom half in green. This is not something of much practical use but would be cool and certainly very educational to see if could be done.
I have been searching to see if i could find some snippet Win GDI API codes which i could adapt to Excel and am also asking here maybe someone has seen this done in excel userforms before.
I have created a user form and I am trying to get the active control colored. I am using the code from Mr Excel's VBA book - starts on page 454, and I have entered all the code, but now when I activate the user form I get an error ....."Compile Error. Invalid attribute in Sub or Function." and when I click OK, it takes me to this line of code.....
Private WithEvents objForm As clsCtlColor
In the book, this is where I am supposed to start entering the code "behind the userform" rather than in the class module. So, I assume this means that this code goes with all the other code for the user form (in VBA project click on form, then view code). Am I wrong? Should I be adding a module? Not sure what I am doing wrong.
Here is the code I have in the class module....
Public Event GetFocus() Public Event LostFocus(ByVal strCtrl As String) Private strPreCtr As String
Public Sub CheckActiveCtrl(objForm As MSForms.UserForm).......
I have a MultiPage userform and I'm adding (4) control buttons - CancelButton, BackButton, ForwardButton and FinishButton. On the first page, those names are fine but when I get to subsequent pages, I get an ambiguous error if I try to name the controls the same. But the code will all be the same. What am I missing? In an example that I have, the user was able to name all the controls with the same name. What setting would control that?
I've got a userform with multiple pages, and in my userform initialize sub I set the focus to "combobox1" on "page1". When a user is on page2 of the form and clicks my "ClearData" button, which calls the initialize event, I get a run time error 2110 - "Can't move focus... etc" I would like users to have the ability to clear the form and start over no matter what page they are on.
i'm trying to build an app that'll take a user through 5 or 6 steps of a process, with maybe 2-3 substeps in some steps. right now i'm currently using a multipage Userform , but all the tabs make the whole thing look cluttered (even when there's a "Next" button in plain sight). this is especially because i've put each substep as a multipage form under that step's page (multipage forms inside a multipage form). so steps 1-5 would each have their own pages (1-5), then in page 1 you'd have another multipage form (1.a. - 1.c.). is there a way to make it look simpler? i'd like it to look a bit like a Wizard (ie remove all the tabs), but the only way i can think of is to throw a whole heap of controls on one page, and turn them visible/invisible each step of the way.
I have large data sheets with blocks of blue-colored cells. I want to surround them with lavender-colored cells. Then I want to run a command to Clear Contents of all lavender-colored cells. Is this possible?
So first I have: Black-text blue-text blue blue Black-text blue-text blue blue Black-text
Then I want: Lavender Blue Blue Blue Lavender Blue Blue.................
I have a userform that has a multi page on it with 4 pages. I notice that there is no way to have the individual pages be set to a click event- or none that I see anyways. What I am wanting is for a series of events to happen based on what page the user chooses from the four (like a userform initialize type event).
I would like to add a combobox type control that will allow multiple selections. I know that the combobox in the MS Forms Object Library only allows single selections and that the list box is the way to go to allow multiple selections, but I am trying to keep the form as small as possible. I would like to add a control similar to the one used on pivot charts, where the user clicks the dropdown box and can select multiple items. I'm hoping this control is installed with MS Office and just needs a reference to it, but I am open to installing third party controls as well.
With the use of the option buttons,the page needs to made visible or invisible.
Example: on Page one, i have placed radio buttons as page2,Page3&page4.
By default only page 1 should be visible and when we select radio button page2, page2 should become visible or else it should be invisible,when we select radio button page3, page3 should become visible or else should remain invisible.
I have a listbox with 8 columns. Multiselect is enabled, and it must stay this way. As part of my program, after the user presses a command button, I need to use the row indexes of the selected rows in order to copy the selected information into an array which is then placed in a different listbox, and then delete the items from the original list. Pseudocode of what I want to do:
[Code] .....
But my understanding is that .ListIndex does not work this way with multiselect listboxes. I've tried searching for a solution for a while, but I cannot find one.
Could I use 1 multipage UserForm Instead of 8 UserFoms. Is it better to use 1 multipage UserForm with 8 pages or 8 UserForms. I dont know if this make sense or not?
how to find the blue text in all sheets? I have around 10 sheets and from each sheet if a cell contains text in blue then that row, row number and the sheet name should be captured in a new sheet.
I want to do the following for each row (starting from row 2) : If D is empty and E has a grey background color - I want the value from E to be copied to D.
I'm very new to VBA, so I don't really know how the syntax works. This is what I've got so far ^^
Public Sub ReplaceIfColor() If ((Range(2, E).Interior.ColorIndex = 15) & (Range(2, D)=0)) Then .Replace D.Value, rngCell.Offset(, 1).Value, LookAt:=xlWhole
I need a script that will search for cells ranges (B2:B81) and (C2:C81) that have numbers that are colored (not cell color) green or blue and then add them together into cell A90.
I need a UDF to test a single cell if it is colored. If it is the result returned should be a 1, if not the result will be blank. This is what I have so far, but I don't know much about VBA.
Function Filled(MyCell As Range) If MyCell.Interior.ColorIndex > 0 Then Result = 1 Else: MyCell = "" End If End Function
Suppose I have a file with many rows of data, some cells are colored (flagged with an error), in several columns C, D, E, F, & G. Not all cells are colored in each row. However I would like to add a column at the end that captures a count if a cell in the row is colored.
Referring to the attached example... I would expect a value of 1 in G3, 1 in H4, 1 in F6, 1 in H7, 1 in D8 and E8.
I am currently using the following formula to count the number of colored cells that are yellow. Problem is, I can't get the formula to automatically update when a new cell is shaded to yellow. I have to click on the cell with the formula, then click in the formula field and hit the enter button. I do not have "manual calculations" checked in the options tab.
I have a spreadsheet in which there is a calendar. On this calendar are cells for the days. In these cells for the days we use colors for Vacation (Purple), Holiday (Pink), Unpaid Absences(Green) and Late days(Yellow). At the top of the page I want a cell that tells me the number of Purples are in a range (B10:X66) and how many pinks, greens and yellows there are. Is there a way to use the 'Count' to count colors in a range?