VBA using named range and cell value

I have to use a variable based on a cell value.
My case statement is working fine, but I need to add a variable to each selection.

In the following CASE statement, if "Letter" then I need a combination of
1. value in column A,
2. "L_",
3. the value in Selection!B11

Can anyone help?

Sub Tags()

   Application.ScreenUpdating = False
   Application.Calculation = xlCalculationManual
   #If VBA7 And Win64 Then
   Dim c As Longlong, lr As Longlong
   #Else
   Dim c As Long, lr As Long
   #End If
   
   Detail.Activate
   lr = Range("A2").End(xlDown).Row

   For c = lr To 2 Step -1

      Select Case Cells(c, "A")

         Case "FO", "PO", "SO", "E2", "E2AM", "ESP"
            Select Case Cells(c, "B")
               Case "Letter"
                  Cells(c, "S") = Cells(c, "A") & "L_"&Selction!B11
               Case "Pak"
                  Cells(c, "S") = Cells(c, "A") & "P_"&Selection!B11
               Case "Box"
                  Cells(c, "S") = Cells(c, "A") & "_Day_" & Selection!B11
            End Select
          

Open in new window

Euro5Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Cells(c, "S") = Cells(c, "A") & "L_" & Sheets("Selection").Range("B11")

Note that Selection was spelled incorrectly.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rgonzo1971Commented:
pls try

Case "FO", "PO", "SO", "E2", "E2AM", "ESP"
            Select Case Cells(c, "B")
               Case "Letter"
                  Cells(c, "S") = Cells(c, "A") & "L_"& Sheets("Selection").Range("B11")
               Case "Pak"
                  Cells(c, "S") = Cells(c, "A") & "P_"& Sheets("Selection").Range("B11")
               Case "Box"
                  Cells(c, "S") = Cells(c, "A") & "_Day_" & Sheets("Selection").Range("B11")
            End Select

Open in new window

Regards
0
Euro5Author Commented:
Thanks again!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Martin LissOlder than dirtCommented:
While my answer was not as complete as Rgonzo's, I don't understand why I was left out.
0
Euro5Author Commented:
Sorry Martin - I honestly just overlooked the response.
0
Martin LissOlder than dirtCommented:
Ok then if you want to change the point assignment to include the both of us then Request Attention.
0
Euro5Author Commented:
@Martin - Got it! I will when they reopen. Sorry, was not paying attention.
0
Martin LissOlder than dirtCommented:
Thanks. Your question refers to "named range and cell value". Out of curiosity, Is there any reference to a named range in the code you posted?
0
Euro5Author Commented:
Thanks. Your question refers to "named range and cell value". Out of curiosity, Is there any reference to a named range in the code you posted?

@Martin - the result - column A,& "L" & Selection!B11 will result in the named range.
0
Euro5Author Commented:
Thanks again. I really appreciate your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.