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 779997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:00:37+00:00 2026-05-14T20:00:37+00:00

How do I achieve the following? Sub Macro1() ‘ ‘ Macro1 Macro ‘ ‘

  • 0

How do I achieve the following?

Sub Macro1()
'
' Macro1 Macro
'

'
    Worksheets("Drop-down").Select
    n = Cells(1, 1).End(xlDown).Row
    For i = 1 To n
        ActiveSheet.Cells(i, 2).Select
        *******************************************************
        If Worksheets("Misc").Cells(2, i).Value = "" Then
            continue i
        End If
        *******************************************************
        If Worksheets("Misc").Cells(3, i).Value <> "" Then
            Set validationRange = Range(Worksheets("Misc").Cells(2, i), Worksheets("Misc").Cells(2, i).End(xlDown))
        Else
            Set validationRange = Worksheets("Misc").Cells(2, i)
        End If
        With Selection.Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:=validationRange.Address
            .IgnoreBlank = True
            .InCellDropdown = True
            .InputTitle = ""
            .ErrorTitle = ""
            .InputMessage = ""
            .ErrorMessage = ""
            .ShowInput = True
            .ShowError = True
        End With
    Next i
End Sub
  • 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-05-14T20:00:37+00:00Added an answer on May 14, 2026 at 8:00 pm

    Isn’t this a simple flow control case? I don’t understand the need for special keywords to solve it:

    For i = 0 To 10
     If Not condition Then 
        some other code
    Next   
    

    EDIT: Or, in your code:

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        Worksheets("Drop-down").Select
        n = Cells(1, 1).End(xlDown).Row
        For i = 1 To n
            ActiveSheet.Cells(i, 2).Select
            *******************************************************
            If Not Worksheets("Misc").Cells(2, i).Value = "" Then
            *******************************************************
              If Worksheets("Misc").Cells(3, i).Value <> "" Then
                  Set validationRange = Range(Worksheets("Misc").Cells(2, i), Worksheets("Misc").Cells(2, i).End(xlDown))
              Else
                  Set validationRange = Worksheets("Misc").Cells(2, i)
              End If
              With Selection.Validation
                  .Delete
                  .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
                  xlBetween, Formula1:=validationRange.Address
                  .IgnoreBlank = True
                  .InCellDropdown = True
                  .InputTitle = ""
                  .ErrorTitle = ""
                  .InputMessage = ""
                  .ErrorMessage = ""
                  .ShowInput = True
                  .ShowError = True
              End With
         ********
          End If
         ********
        Next 
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Can you split what you're doing into two parts, one… May 16, 2026 at 4:02 pm
  • Editorial Team
    Editorial Team added an answer You can't do that. All you can do is write… May 16, 2026 at 4:02 pm
  • Editorial Team
    Editorial Team added an answer stackT *stackPtr defines stackPtr as a pointer to stackT. The… May 16, 2026 at 4:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to achieve the following without using sub query. For a funding,
How to achieve the following query - SELECT CASE WHEN COUNT(*) > 0 THEN
I am looking to achieve the following: Display 5 images in a row Click
im trying to achieve the following, in php i have a form like this:
I am trying to achieve the following: I have a single ORDER BY statement
In the below image I am trying to achieve the following.I have a table
What I want to achieve is the following; I have a textarea filled with
The following code works, but I'm sure there is a more compact way to
I have the following file structure (XML files 'index.xml' in nested folders): index.xml foo/index.xml
For the following code: class Image(models.Model): alt_name = models.CharField(max_length=200) url = models.CharField(max_length=255, blank=True) class

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.