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

  • Home
  • SEARCH
  • 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 8557935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:41:22+00:00 2026-06-11T15:41:22+00:00

I am using below code to read excel file: I want to print only

  • 0

I am using below code to read excel file:
I want to print only first row data, for that I require to find no of rows in sheet (non blank) .

Set xlBook = GetObject(FilePath)
xlBook.Application.Visible = True
xlBook.Windows(1).Visible = True
xlBook.Application.WindowState = xlMinimized

Dim irow As Integer

For irow = 2 To 101
    MsgBox xlBook.Worksheets(1).Cells(irow, 1).Value
Next
  • 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-11T15:41:23+00:00Added an answer on June 11, 2026 at 3:41 pm

    Unfortunately I will not recommend UsedRange.

    Two reasons

    1. UsedRange will not give you no of rows in sheet (non blank) as you want it.
    2. UsedRange is highly unreliable. If you want to find the last row then see this link . Please note that this will still not give you number of NON Blank Rows.

    To get the number of Non Blank Rows, you will have to use AutoFilter. Use <>"" as the autofilter criteria and then use the visible cells rows count to get the non blank rows.

    Edit:

    See this link

    This post deletes all columns which are empty apart from a specific header. I am sure you can modify it to suit your needs.

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

Sidebar

Related Questions

I'm trying to read an Excel (xlsx) file using the code shown below. I
I want to read Excel file in c# using following code string excelFileName =
I have wrote a code that can read an excel 2007 file using Microsoft
I'm using the code below to read a text file that contains foreign characters,
I am using ASP.NET to read the data in the excel file. I am
I am using the below code to read .docx file and it is successfully
I am using the below code to read one xml file which is located
I have to read from a Excel file using X++ Code. Bellow is the
I am reading a plist file using code below. My problem is that the
I am trying to read a file line by line using the code below

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.