+ Reply to Thread
Results 1 to 4 of 4

Column counting

  1. #1
    Registered User
    Join Date
    06-15-2017
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    2

    Column counting

    Within my custom function in VBA Excel 2010, how do I count columns with numbers only, instead of all of the columns... n = returns.Columns.Count

    I've tried several things over the last few hours and for some reason, I continue to fail. The above "n" variable appears to be the cause of a #VALUE! error result due to the blank cells and text cells in the range... or so I think it's that. I'm hoping that if I can remove the counts of columns that don't have numbers, then the calculations will succeed. My function works when all of the columns have numbers.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Column counting

    Is this what you mean?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,543

    Re: Column counting

    Or if you don't know how many Columns.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-15-2017
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    2

    Re: Column counting

    Thank you for your help. Where would I insert that code? Here is my Function...

    Please Login or Register  to view this content.
    MODERATOR COMMENT: I have added code tags for you today. Please read the forum rules you agreed to and comply in the future.
    Last edited by alansidman; 06-15-2017 at 09:38 AM. Reason: code tags added

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] COUNTIFS - Counting in order in one column, Counting only specific cells In another
    By kslattery in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2017, 01:17 PM
  2. [SOLVED] Help in counting D if column a is x and column b is y, count column c with a price of XXX
    By grlnexdor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2013, 02:03 AM
  3. Counting Unique text in column B based on a criteria from column a
    By clocmasta in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2013, 06:40 PM
  4. Replies: 4
    Last Post: 04-25-2013, 03:53 AM
  5. [SOLVED] Counting Multiple Values in a column based on critera in seperate column
    By ERoberts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 01:08 PM
  6. Replies: 2
    Last Post: 01-04-2012, 10:22 AM
  7. Counting cells in offset column based on contents of another column.
    By Big Chris in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-10-2008, 09:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1