Results 1 to 3 of 3

Select Case Statements

Threaded View

  1. #1
    Registered User
    Join Date
    03-16-2008
    Posts
    3

    Select Case Statements

    Please read forum rules - You must add the link to the cross post

    So, it seems that i have a problem with this code. I am trying to get a information from one column to match it with another column to get me a result.

    For example,

    I have a Cake on Range("D5") and From Range("B5:B19") i have a cake that consist of 5 cakes. So i want to put that value 5 into Range("E5")

    B5 Cake
    B6 Cake
    B7 Cake
    B8 Cake
    B9 Cake
    B10 Muffin
    B11 Muffin
    B12 Bread
    B13,B14..... etc

    D5 Cake

    E5 5

    So, I am requesting how many Cakes are there from B5:B19, And D5 is the name # of Cake, So E5 i put 5

    Function GetCakeRow(strCake As String) As Integer 
         
        Select Case strCake 
            strCake = Range("D5:D23") 
             
        Case Is = Range("F5").Value 
            strCake = 5 
        Case Is = Range("F6").Value 
            strCake = 4 
        Case Is = Range("F7").Value 
            strCake = 3 
        Case Is = Range("F8").Value 
            strCake = 4 
        Case Is = Range("F9").Value 
            strCake = 3 
        Case Else 
            Range("F5:F9").Value = 0 
             
        End Select 
         
    End Function
    or can someone give me some one on one help at AIM- ladeda063610
    Last edited by VBA Noob; 04-06-2008 at 02:50 AM.

Thread Information

Users Browsing this Thread

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

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