case

  1. R

    [VBA] Case like "X", "Y", "Z", "" not working

    Hi all, I'm declaring my source as "src" and my discount as "dis" src will always be a value, but dis can either be a value or blank. An example will be src = NQS and dis = "", or src = NQS and dis = NQS20 My code is below: src = Cells(ActiveCell.Row, "F").Valuedis =...
  2. J

    Change font color and style

    Hello, I came across this code which changes the Font color for individual names within a Range. How can i also include the functionality to change the font Name, Style Size and Boldness for each individually? Thanks for any help! Sub Change_FontColor() Set MyPlage = Range("NamesList")...
  3. S

    Help to Select Case with dynamic range

    Hi All I want to have a Function with select case that: range value is range(A2: last row) and group by range(B2:lastrow) like below table have 04 group: The code of function like this: Funtion () for i = range(A2: lastrow) select case group by range(B2:last row) Case a = Array("B004") 'group...
  4. K

    ComboBox BackColor change on value

    I have a ComboBox that I am trying to get the BackColor to change based on a selection. There are 11 ComboBoxes on the sheet. After I have gone through all the boxes and made the selections I hit the finish button which runs the VBA code. Using ActiveX ComboBox. This is the code I tried using...
  5. T

    SOLVER: How to call a VBA subprocedure after each solver iteration?

    Hi Mr. Excel, I've scoured the internet and can't find the answer to this question. Everyone seems to get stuck in the same place (case #1, case #2, case #3, case #4). The guidance for the SolverSolve function indicates that you can use ShowRef to pass a macro/sub into Solver after each of...
  6. L

    Multiple subs in VBA Code ?

    Good morning. I am working on the same spreadsheet described in this thread (https://www.mrexcel.com/forum/excel-questions/1112241-hiding-rows-using-vba-multiple-criteria.html) It is a sheet where based on the answers provided in a set of dropdown boxes, certain rows need to be hidden...
  7. TAPS_MikeDion

    How to know which button in group was selected?

    Hi all, I have three (3) button in a Group: Group Name: Sorting Button Names: FirstNameSortButton LastNameSortButton LocationSortButton Since a ComboBox cannot show more than 1 column when the "ComboBox1_Change()" event fires, I had to overlay a 2 column ListBox on top of my ComboBox so all...
  8. B

    help with dates in VBA

    I'm relativity new to VBA. I am hopeful someone can help me with the below macro. The Macro takes a day of the week like Monday or Tuesday and converts it to a real date based on whats imputed. It works the way I want other than, I need it to be formatted as a 2 digit month 2 digit day and 4...
  9. K

    Help with Select Case

    Hi All, I need help with a Select Case in my code. I'm new to VBA and have never used the Select Case function. With my online research, I found some examples, but none is really giving me the information that I need. When the user call a UserForm (frmResource) from any one of the sheets Monday...
  10. kelly mort

    For loop with irregular step or use arrays if possible

    Hi again, I got something I think is a big problem for me but I don't know what you think: I have a loop like For i = 1 To 100 ......... Next The loop is pointing to numbers in column B. However, all the numbers may not be present. For example, 2 or 54 etc, may not be available in the...
  11. willow1985

    Drop down box value to trigger macro

    I have drop down lists in column O where you can toggle the status from "blank", to "open" to "closed". What I would like to do is have a certain macro run every time the status is changed in any of the cells in column O. the following vba code that I currently have (that I inserted under...
  12. A

    OBIEE Case formula

    Hi all, I am trying to write a case in OBIEE for the first time. It does not like what I am doing. Can you take a look? I am trying to write a case based on the customer name ( we have about 15 special names give or take) that need to be identified, the rest get assigned to a category called...
  13. I

    A-Z list box isnt in order

    Hi, I have a worksheet which is sorted from old to new date in column A where A9 is 02/01/2017 & A978 is 07/10/2019 In column B are the customers names. A code collects all the names column B & sorts them into an A-Z order, this takes place in column L I have a userform where a field called...
  14. K

    Timesheets and Userform

    Hi All, I built our weekly/daily time sheets some years ago in Excel using mostly formulas to do the calculations. This worked great, but since I started to learn more about vba and userforms I am busy streamlining it to use userform inputs and vba to send the information to the relevant...
  15. L

    select case is not working

    Hi Why when I enter 66 as a number, this code print "Else"? it does not go the first case? any idea why? I used F8 but again jump to the last case. Thank you very much. Sub test3() Dim x As Integer x = InputBox("enter number") Select Case x Case x > 50 MsgBox...
  16. D

    What is wrong with my select case statement

    This is the start of my select case statement and it has an error and I can't figure out why, can someone help me please? Dim printWorksheet As Worksheet, logoShape As Shape, tempImageFile As String Dim city As String Set city = ThisWorkbook.Worksheets("Start_here").Range("H9").Value...
  17. T

    Return a Blank if Error OR 0

    Hi guys, Wondering if anybody a help with the following: I am currently using the following formula to return blanks when an error results from 'E25' being blank: =IFERROR(VLOOKUP(E25,'WORKSHEET'!$A$1:$S$1000,19,FALSE,"") However, when E25 is not blank but row '19' in '$A$1:$S$1000' has no...
  18. L

    (substitute, replace) VS replace tool

    Hi I know how and when to use substitute() and replace() function. But my question, I found that Replace tool is doing the same. Is there any case that Replace tool is not going to help then I will have to use substitute() or replace() functions. Thank you very much.
  19. G

    Assistance needed in amending a macro.

    Hi I had this macro that compared data between sheets 1 and 2 and marked "OK" "MISSING" and "DUPLICATE" What im trying to amend it to do is to mark "OK" and "DUPLICATE" on sheet 1 still but when data is on sheet 2 but not on sheet 1 I need it marked "MISSING" on the row concerned on sheet 2...
  20. S

    [VBA] Unable to sort tabs of selected sheets

    Sub SortSelectedWorksheets() '--------------------- MTxt = MsgBox("- Sort Selected Worksheet(s) -" & vbNewLine & "---------------------" & vbNewLine & _ "Yes : Ascendingly" & vbNewLine & _ "No : Descendingly", vbYesNoCancel) '--------------------- SheetCount =...

Some videos you may like

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top