Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8234641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:33:05+00:00 2026-06-07T18:33:05+00:00

I can not figure out why VBA is yelling at me on this one.

  • 0

I can not figure out why VBA is yelling at me on this one. Very simple code, only one if statement is involved, and it clearly has a “Starting” If and a matching End If. I am a VB.NET developer, so it may be a difference in the syntax that I am missing.

 Sub splitter()
   Dim line() As String
   Dim rng As Range
   Dim row As Range
   Dim cell As Range
      For Each row In rng.Rows
        If row.Value <> "" Then
            line = Split(Range(row, 1), ",")
            Select Case line(0)
               Case "Desktop"
                   Range(row, 8).Value = "Desktop"
               Case "Laptop"
                   Range(row, 8).Value = "Laptop"
               Case "Server"
                   Range(row, 8).Value = "Server"
               Case Else
                   Range(row, 8).Value = "N/A"
        End If
       Next
    End Sub

Specifically, the end result is that it will populate a “Child” drop down list (Range(row, 8)) based on the selection made from of the “Parent” drop down list (Range(row, 1)). Because the question will arise, the reason I am doing this using VBA is because I can utilize the Split() function with the way the items in the Parent drop down list are made eg. “Desktop, Dell, 745”. Also, I am a better programmer than an excel developer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:33:07+00:00Added an answer on June 7, 2026 at 6:33 pm

    Your select statement needs an end:

    Select Case line(0)
       Case "Desktop"
           Range(row, 8).Value = "Desktop"
       Case "Laptop"
           Range(row, 8).Value = "Laptop"
       Case "Server"
           Range(row, 8).Value = "Server"
       Case Else
           Range(row, 8).Value = "N/A"
    End Select
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can not figure out why the following AJAX code will only load the
I can not figure out why I get this error. As the code is
I can not figure out what is going wrong but on this simple PHP
I can not figure out why this code: class HelloWorld { HelloWorld() { System.out.println(1
I have to implement simple ray tracing algorithm, but I can not figure out
I can not figure out why my code is not working, key_one= raw_input(Enter key
I can not figure out why this won't work. When I run it I
I can not figure out why my code does not filter out lists from
This MySQL query is failing and i just can not figure out why. Any
I am getting this error and I can not figure out where the problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.