Results 1 to 3 of 3

Counting number of non-blank cells in column......but getting run time error in vba

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Counting number of non-blank cells in column......but getting run time error in vba

    Hi,

    I have set up a range in vba as follows (see rngsourcedata):



    Dim fl_name As String
    
    Dim rngsourcedata As Range
    
    fl_name = ThisWorkbook.Name
    
    Set wrksht_data = Workbooks(fl_name).Worksheets(1)
    
    status_col = 10
    
    Set rngsourcedata = wrksht_data.Columns(status_col).SpecialCells(xlCellTypeConstants)

    The problem is that if status_col is "empty" then i get a run time error.

    I thought if a range is empty that it would evaluate to "Nothing"......not cause a runtime error.......


    any thoughts/ideas?
    Last edited by welchs101; 04-30-2012 at 01:18 PM.

Thread Information

Users Browsing this Thread

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

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