select case

  1. C

    VBA to Hide Rows

    Hello, I am wanting a macro to automatically run when a spreadsheet is opened to check a cell to see what month it is then hide some rows off the back of that. It should look something like the below saying if C5 is one of those months then hide rows 12-18 in the sheet Check List. Private...
  2. T

    Select Case - Squishy spot on forehead

    After digging through umpteen references - I'm still trying to figure out what I'm doing wrong here. Per the comments in the code: I have a workbook where on one worksheet there is a named range - _FST with a drop down select for yes or no. Based on the answer I want to perform a SUM of 40 -...
  3. A

    Multiple Statement Select Case

    I have been trying to search how to do this and have not come across anything that helps me with what I am trying to accomplish. I have seen select statements with multiple conditions, but not multiple actions. I am trying to replicate a calculation based on if the action is done daily. I am...
  4. G

    Looping Through Select Cases

    Hello All, I have a independent combobox and a dependent combobox, the dependent combobox depends on the information provided in the first independent combobox. I know there is the select case to make fill the dependent combobox. Here is a brief overview what my code does. I have two...
  5. B

    VBA Help. Select Case based on worksheet name

    I have three different macros that make various format adjustments. 1) intacct_CMA 2) intacct_events 3) Intacct I'm trying to consolidate the three macros into one by using a Select Case Statement based on the Worksheet names. I would like for: - macro #1 to run on the worksheet named...
  6. M

    Multiple case <>

    Good morning or afteernooon to everyone: I've this little piece of VBA code that it's not working: Select Case PAc_ALACase Is <> 5, Is <> 10, Is <> 15, Is <> 20, Is <> 25, Is <> 30, Is <> 35, Is <> 40 Do whatever End Select Where PAc_ALA is an integer. Anyway, I tried in a different...
  7. S

    use range variable in command to set selected cells all uppercase

    I want to select cells and turn them upper case. the cells selected will change each time. I have tried a few things and had no luck the first way it did not want to do it bc I think my use of the range variable in the actual command is not right. 'set range based on selected cells Set...
  8. W

    Range.currentregion and offsetting a case to range count

    Hi everybody. I've been tinkering with a small code section using the Currentregion and trying to offset a case based on it What I was hoping for, was a currentregion.rows.count = x, lets say 10. Then for each of those 10 rows, it would apply the cases below on offset(0,12) and (0,13). I...
  9. G

    SELECT CASE with several CASES

    Hello, This is a continuation of a previous post, but I thought I should start a new thread since this is about SELECT CASE. (https://www.mrexcel.com/forum/excel-questions/1021927-excel-vba-use-consecutive-if-statements-use-if-elseif.html) I'm now using SELECT CASE code to do 2 things: 1)...
  10. M

    VBA - Cut and Paste from Select Case

    Hi all Trying to have Excel move a pieces of data from a sheet called import to another sheet called format, however the below code comes up with either "PasteSpecial method of range class failed" or "Cut method of Range class failed" when it tries to copy inside the select case portion. I've...
  11. B

    IF Statement Or Select Case Help Please

    Good Morning Guys, I hope you are all well. I am just in the process of setting up a new part time employee on a Holiday Spreadsheet I have made which uses NETWORKDAYS to determine the amount of holiday the user is after. So when the User selects for example 12.04.17-13.04.17 that would be 2...
  12. J

    Brand new to VBA trying to use Select case function

    I am trying to use the Select Case function. I'm currently running into a run-time error "9". I know I am probably missing some basic VBA info, but I cant seem to identify what it is. here is my code Sub HistoryPull() With Worksheets("Data and Forecast-Prelim") Select Case Range("I6")...
  13. T

    VBA Concatenate two columns after select case

    Hey guys so I have a large set of data. The macro I have right now looks up the name of the person then goes about 15 columns to the right which has people/ gift in the format X / Y, and the column after that has a list of ages Z. What I need to do is fix up the data so it says X People(Person)...
  14. T

    VBA Combining Select Case with Private Sub for data management

    Hey guys, so I'm trying to fix a set of data column by column. So for example I have <tbody> Pass Score Age Gender No 40 21 Male Yes 92 19 Female Yes 87 45 Male No 69 60 Female Yes 72 37 Female </tbody> and I want <tbody> Pass Score Age Gender N 40-49 20-25 M Y 90-100 15-19...
  15. S

    Sorting Copying and Pasting By State Abbreviation

    Hey guys, so here is my code: Public Sub newcopy() Dim WSCount As Long, StartCellRow As Long, i As Long Dim sht As Worksheet Dim region As String WSCount = Worksheets.Count - 2 Application.ScreenUpdating = False For i = 3 To WSCount + 2 region = Sheets(i).Range("E1").Text...
  16. F

    if column does not contain value then do not create pivot table

    Hello dear Excel users, I wrote a macro that is creating 3 pivot tables, all in separate sheets, from the same table (table1) in the sheet RAWDATA. The last pivot table must be created only when at least 1 row in table1 in column K is containing the word TRUCK. If no rows exist with the word...
  17. madkinson

    SELECT CASE: Case Is a Value or Blank

    I have a portion of a SELECT Case statement that I want to fire based on whether there is a value in the cell or whether it is blank (see HIGHLIGHTED): Select Case Range("T" & ActiveCell.Row) ' Action Case "Removed" Select Case Range("R" & ActiveCell.Row) '...
  18. G

    VBA Target Address Select Case Issue

    Hi all, need some help as I do not know VBA. I have a form that my company uses to hire new folks. One of the cells is a Organization selection drop-down. Because of what other items are in that column I cannot re-size the whole column but want the drop-down to be wider when it is selected...
  19. R

    Select Case Target.Address for range of cells

    Hi I have a working code to make a calendar pop up when ever someone selects a specific cell. However I would like to make it work for whenever a cell in a range is selected ("G2:G3000 "I2:I3000" "J2:J3000 "L2:L3000") or anywhere in column G, I, J, and L. The code I have at the moment will...
  20. svendiamond

    Case IsDate?

    How can I use Select Case to determine whether a cell contains a date? For example, I am looping through the following cells: Cookies 12/2/2015 Apple Banana 123 Example Select Case testCell.Value Case Is = "Cookies", "Apple", "Banana" MsgBox "this is a...

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top