select case

  1. B

    Select Case Isn't Working Correctly

    Hello, I'm very new to this still and can't figure out why my select case loop isn't working. I just want it to format my headers if they match specific text values two of the cases are shown below for "FEA" and "SUN". When I run the code it only changes the cells to one color, not two...
  2. L

    Trim and compare text via VBA macro

    I am trying to write a macro that filters a list based on criteria in a particular column and transfers the information to another sheet. There is a problem with the line xmitter_type = Application.Right(Trim(Cells(j + 2, 5)), 1) within the overall procedure of: Dim cell As Range Dim...
  3. L

    Converting multiple if then statements to select case

    Hi, I am hoping someone can help here, I performed a search but did not see a result specific to my issue. We are pulling data from a database with several columns. Column A has country and column B has a subsidiary. Unfortunately, due to a bug in the system the countries don't appear, so in the...
  4. C

    Select Case help (vs IF statement)

    I currently have a spreadsheet that has a nested IF statement to determine some quantities, and I think it may be better to use the Select Case instead of what I have, but I'm a little unsure as how to go about that. Here's my current forumla...
  5. L

    Loop through spreadsheets and run individual code

    Hello All, I have a workbook that will have some raw data on about 40 worksheets. I want to clean the data up and make it look presentable. Sheet1 is unique, Sheet2 is unique, Sheet3-40 are all the same (format-wise). I've been trying to create a loop that uses a Select Case statement to...
  6. M

    Select Case - Loop - Delete Row

    OK, so I have the following code: Dim oneCell As Range Dim HeaderRange As String Range("Z1").Select Range(Selection, Selection.End(xlDown)).Select HeaderRange = Selection.Address For Each oneCell In Range(HeaderRange) If oneCell.Value = "" Then GoTo skip End If...
  7. M

    Select Case Issue - Change Gender after finding the gender column

    Ok, this should be super easy but for the life of me I can't figure it out. I need some code that will find the column with the header of "Gender" and change the values from "M" and "F" to "Male" and "Female" but I keep running into issues. Can someone give me some super easy code to do this...
  8. S

    Smarter if-sentence?

    Can I write this smarter? Maybe a select case-statement? If A Then Let MethodType = 0 ElseIf B Then Let MethodType = 1 ElseIf C Then Let MethodType = 2 End If
  9. D

    VBA Select case complication

    I'm trying to shoehorn one macro into another using the select case method: The green part of the first macro works, and prompted me to expand the macro. The red part of the macro only works on some sheets. I kept the green part in case there is something important there. The red part gets the...
  10. T

    Select Case User Defined Function

    All- I'm really jammed up on this one and need urgent help for a project due today. I have a very large workbook that stores all of our currency information. Basically I need to be able to get a currency exchange rate from a table and run some sort of calculation with that rate. So for...
  11. E

    Select Case on Iterator Variable Not Working As Expected

    I have had this problem in multiple different macros so I will just provide an example of relevant code: For J = 0 To 3 Select Case J Case J = 0 LikeVar = "a*spk1*E0" LikeVar2 = "a*spk1*E7" End Select Next J For some reason it skips over the likevar variable...
  12. P

    Append a variable in a variable select case method

    I want the select case list of a ComboBox to be treated as a variable in order to shorten the code size. To clarify the problem, i post the code with what i want to do, but don't know how to do it that way. Select Case ComboBox1.ListIndex Case 0: y = "\AT" For...
  13. D

    Loop and Select Case Problem

    I have a worsheet labeled "test". In column A1 through A100 I have codes such as A1=00100, A2=0230, etc. I am looking to use the select case method and a loop to find the various corresponding descriptions that go with the code. So A1 = original code as entered and B1 = description found using...
  14. K

    perform multiple actions using 'select case'

    I'm trying to figure out how to execute more than one action using select case.. So, for example Case 1: x = "Apple" AND y = "Peach" making x = Apple is fine and straight forward.. but I can't figure out how to tell it to also make y = Peach clearly using the word AND in between is not...
  15. B

    Select Case from Dynamic Range

    I have a workbook with multiple sheets, some of which end in a 4 character string that tells the code to go and grab information out of that sheet. I have the following basic code structure and it is working great. The problem is that the user may need to add new sheets that meet the "Case"...
  16. FracinDean

    Worksheet Change Event Using Named Ranges

    Can I use named ranges to trigger actions using the Worksheet Change event? I'm having trouble discovering the correct syntax. I tried Target.Range and Target.Name and Target.Address but those didn't work for me. I have several different cells & actions, so something with a SELECT / CASE...
  17. J

    Select case problem Excel 2010

    I use the following script in Excel 2000 and it works perfectly, for some reason in Excel 2010 version it bugs out at the case "DB", "" line, it says type mismatch. Can anyone help to fix this as it is an important piece of code and there are another four pieces of code similar, so if it won't...
  18. R

    Select Case Possible?

    Sorry I have so many posts, I'm just a noob with a big project to finish lol. So I'm pretty sure I can use Select Case for what I want to do, I'm just unsure of how to do it. I have a form with a listbox and 5 option buttons. Each of the option buttons needs to populate the listbox with...
  19. JackDanIce

    Select case not working

    Hi, Please can someone help me understand why this code for a select case isn't working, it's skipping straight to the Case Else line - the worksheets with the case names do exist in the workbook as they have been created by another macro and the cases match too: Sub CountRows() Dim ws As...
  20. P

    VBA Case Query

    Hi All, Hope you can help. I'm designing a frontend for users to enter specific details about a customer which will be referenced against a watchlist and i'm having trouble getting the desired response for two reasons. a) my first case query is fine when the Case is true however the CaseElse...

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