Results 1 to 9 of 9

Selcet cases after first case not working

Threaded View

  1. #1
    Registered User
    Join Date
    01-06-2020
    Location
    Denmark
    MS-Off Ver
    2013
    Posts
    4

    Selcet cases after first case not working

    Hello

    I have a problem where when I fill out a specific cell with "x" it's suppose to give a value in another worksheet. It's working for the first Select case, but cases that comes after isn't working.

    I Run a If Isempty code to start with to avoid a Mismatch error.

    My code Is

     Dim Value As Integer
      Dim Celle As String
    
    Celle = target.Address
       
        If IsEmpty(Range("H3,H10,H16,H24,H32,P3,P10,P21,P30,P38")) = True Then
            'do nothing
            
        Else
               
            If target.Value = "x" Then
        
        
                Select Case Celle
                
                    Case "$H$3"
                        Worksheets("Sheet2").Range("B2").Value = "1"
                
                    Case "$H$10"
                        Worksheets("Sheet2").Range("B2").Value = "2"
                        
                    Case "$H$16"
                        Worksheets("Sheet2").Range("B2").Value = "3"
                                     
                    Case "$H$24"
                        Worksheets("Sheet2").Range("B2").Value = "4"
                        
                    Case "$H$32"
                        Worksheets("Sheet2").Range("B2").Value = "5"
                
                    Case "$P$3"
                        Worksheets("Sheet2").Range("B2").Value = "6"
                        
                    Case "$P$10"
                        Worksheets("Sheet2").Range("B2").Value = "7"
                        
                    Case "$P$21"
                        Worksheets("Sheet2").Range("B2").Value = "8"
                        
                    Case "$P$30"
                        Worksheets("Sheet2").Range("B2").Value = "9"
                        
                    Case "$P$38"
                        Worksheets("Sheet2").Range("B2").Value = "10"
                        
            End Select
    
        
    End If
    End If
    
    End Sub
    Last edited by Martinw94; 01-17-2020 at 10:28 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 09-19-2017, 03:27 PM
  2. [SOLVED] Select case where value is numeric then select other cases
    By scottiex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-06-2015, 11:03 PM
  3. [SOLVED] Userform : add value according selcet column range : Solved by (nilem)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2014, 06:12 AM
  4. Add cases opened and closed for each month and specifics about the cases.
    By ChrisLaRoc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-04-2014, 08:19 PM
  5. [SOLVED] code not working in all or all cases
    By s4driver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2013, 11:32 AM
  6. adding more cases to case statement
    By johnson1421 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2012, 10:49 AM
  7. Proper Case not working
    By duckboy1981 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-10-2008, 08:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1