select case

  1. 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...
  2. R

    looping within a select case

    I have been given the data below which has credit scores as well as ratings. the whole point is to write a code that will assign a rating to a credit score. Im not sure if im making sense but its much easier to understand when looking at the data. I have been told that you could use select...
  3. D

    VBA match 4 conditional values at once with Select Case.

    I am building a VBA search function across 3 product sheets (one at a time) for determining the next available size of packaging for a part (my attached example is available here VBA match 4 conditional values at once with Select Case. ). The search is based on 4 input criteria (length...
  4. K

    Select case or IF

    I created a kind of calculator, here's where I'm stuck, and it's the last part of it. Let's say cell c4 has a value that is the base Now I have 4 choices (checkboxes) with values to choose from. When you select a choice, I need to add that value to the base value to come up with a total...
  5. C

    Using Select Case with 1D arrays

    Hi All, I'm trying to use select case to take some data from a 1D array and place them in specific columns in a new worksheet; I've attempted to write the code and having never used select case before I know I've not done it quite right, but hopefully it'll help to explain what I'm trying to...
  6. P

    How to use True or Null as a Case in Select Case Statement?

    How to shorten this statement: If sheet.Previous.Range(SingleArea.Address).HasFormula = True Or IsNull(sheet.Previous.Range(SingleArea.Address).HasFormula) Then Select Case Case True or Null Statement End Select
  7. K

    Using Select Case to pass a variable to AutoFilter as Range

    Hello All, First off, thanks for the innumerable solutions, advice, tips and codes that I have used in the past, this is my first post but I've used this forum to solve many an intractable problem. All of my excel / VBA is self-taught, although I have a grounding in programming. Problem...
  8. N

    Using array with selec case statement

    Hello to everyone! I'm a newbie with vba so i would like to know is my idea is viable I would like to allow my user to update a select case statament without having them to edit the code. I just wrote values i want to use in select case in a range and built an array: Dim BOX_INPS As Variant...
  9. D

    Quicker way to use For, If and Case?

    I have a column of data and I'm looking to find all the points where the sign changes and define these points as either "peak" or "baseline" based on which way the sign changes. My data can have several hundred rows. I have code that works (see below), but I was wondering if there is a quicker...
  10. B

    hexadecimal calculator using Do Until-loop and select case

    I am trying to write a macro that converts a decimal number into a hexadecimal using Do Until-loop and select case here is what I have so far when I run it the computer freezes up Sub HexConverter() Dim L As Double Dim K As Integer Dim N As Double Dim R As Double Dim A As Double Dim P As...
  11. A

    VBA Select Case error: procedure too large

    Hi, I have 30 different cases working well in one module so far. Now I need to add some more cases, but the system doesn’t allow me to start defining any new cases under Select – Case, it shows: compile error: procedure too large. I’m thinking maybe there’s a way to combine multiple cases...
  12. J

    Coding combobox to set autofilter parameters in worksheet

    I am pretty new at VBA and am not sure why I am getting object error 424 Here is the code so far. Private Sub Workbook_Open()With Sheet1.ComboBox1 .AddItem "" .AddItem "5% or less" .AddItem ">5 - 15%" .AddItem ">15% - 25%" .AddItem ">25% - 35%" .AddItem ">35%" End With With Sheet1.ComboBox2...
  13. T

    Use Select Case to launch an MsgBox

    This seems easy enough, but can't get it right. Sheet 1 has a column of 4 cells, B4 through B7. I want to immedialty alert the user that s/he has entered a value greater than 1 in any of the 4 cells at the time s/he is enters the value. I don't wan't the user to wait until all 4 values have...
  14. Johnny Thunder

    Excel 2010 VBA - Select Case Failing to Run

    Hello all, I have been working on a macro project and have come to a halt. My macro is looking at a named Range (RunMacroRule) to get a variable 1-3. depending on the variable it will do an action. See code below. Right now for some reason the code is not running and I am getting the cursor...
  15. A

    Move Entire Row to New Worksheet if Cell Contains Specific Text?

    Hi everyone, I am trying to write a macro that scans a selection of cells in one sheet and then cuts any rows from this sheet and pastes them into another sheet if the cell contains a particular text. As it stands I have two worksheets labelled "Data" and "Errors". On the Data worksheet I...
  16. H

    Select Case Alternative

    I had program that worked well and utilized the select case method. However, from my understanding, the select case will only work with a finite number of choices. My problem: Initially, the program gathered log returns based on currencies from a csv file. The program supported 10 currencies...
  17. K

    Setting format restrictions cells.

    Hello,Hello, I am trying to write code that will allow only certain formats in a cell: E.g. Case [A1] If 0 < Len(Target.Value) And (Len(Target.Value) > 2 Or IsNumeric(Target.Value) = False) Then MsgBox "Value entered must be a 1 or 2 digits long number."...
  18. L

    Combobox Form Control: Select Case Error

    Hello, I am working with a piece of code found here: http://www.mrexcel.com/forum/excel-questions/249841-hide-unhide-rows-selecting-letter-combobox.html. My version of the code is aimed at hiding certain columns based on a the selection in the combobox. The combobox object was initially added...
  19. S

    VBA, IF THEN, SELECT CASE or ...

    Hello All, First of all Happy Easter to all of you! I am a beginner in VBA and mostly self learner (using various examples if this forum and other internet sources). Currently I need to write a code however I faced a wall and I am stucked there. The code you will see in the VBA editor took me...
  20. B

    Debugging my formatting module

    So I don't know what's going wrong with my code, it's just designed to automate a formatting task that I repeat often at work. I've put comments in for all the subroutines to explain them but basically it finds the used range, borders it, formats the headers, uses select case to find specific...

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