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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:11:39+00:00 2026-06-13T23:11:39+00:00

The code at the bottom checks to see if cell (1,b) is empty and

  • 0

The code at the bottom checks to see if cell (1,b) is empty and then copies in a column and performs a text to columns on it. However I would like it to check if column b is empty instead of just this first cell. It should be straightforward but any changes I have made have not worked. For example I have tried:

If Excel.WorksheetFunction.CountBlank(Excel.Sheets("TOP LINE").Columns(b)) <> 1048576 Then
b = b+1

Instead of:

If Cells(1, b) <> "" Then b = b + 1

Please Help!

For a = 2 To 60

If Excel.WorksheetFunction.CountBlank(Excel.Sheets("Paste In").Columns(a)) <> 1048576 Then

    Excel.Sheets("Paste In").Columns(a).Copy

    b = Excel.Sheets("TOP LINE").Cells(1, Columns.Count).End(Excel.xlToLeft).column

    Excel.Sheets("TOP LINE").Select


    If Cells(1, b) <> "" Then b = b + 1


        Excel.Sheets("TOP LINE").Columns(b).EntireColumn.Select
        Excel.ActiveSheet.Paste

        Excel.Application.CutCopyMode = False
        Selection.TextToColumns Destination:=Cells(1, b), DataType:=xlDelimited, _
                TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
                Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
                :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
                Array(7, 1), Array(8, 1)), TrailingMinusNumbers:=True

End If

Next a

  • 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-13T23:11:40+00:00Added an answer on June 13, 2026 at 11:11 pm

    You can use the worksheet function to count nonempty cells in a column with column index a:

    If Application.WorksheetFunction.CountA(Excel.Sheets("Paste In").Columns(a)) > 0 Then

    you have both a as b in your code, please use this code for both instances:

    line 2 (If Excel.WorksheetFunction.CountBlank(Excel.Sheets("Paste In").Columns(a)) <> 1048576 Then) becomes:

    If Application.WorksheetFunction.CountA(Excel.Sheets("Paste In").Columns(a)) > 0 Then

    line 6 (If Cells(1, b) <> "" Then b = b + 1) becomes:

    If Application.WorksheetFunction.CountA(Excel.Sheets("TOP LINE").Columns(b)) > 0 Then

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the code. I want to align text at bottom <p style=background:#eee;font-size:1.3em;color:#022662;height:116px> <img
I would like to filter out particular columns with a regex and discard others.
This code should i place this code at bottom of body it's in conditional
I added the solution to the code below. The code at the bottom is
Anyone have code to set margins(top,left,right,bottom) using excel interop and vb.net. I think it
EDITED SO THE CODE IS CORRECT (THANKS TO ta.speot.is) - NEW QUESTION AT BOTTOM
I have the following code but it doesnt seem to work: <td align=center style=padding-bottom:52.5px>
I have no idea why but only the bottom div works the code is:
I know that I need to add the tracking code snippet at the bottom
I am trying to use a bit of code I found at the bottom

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.