Link to home
Start Free TrialLog in
Avatar of Sandra Smith
Sandra SmithFlag for United States of America

asked on

Loop through column when naming ranges, but skipping empty cells until end of loop.

I have the below code and with the help of Sid, it works as I wish.  However, now I need for it to actually go through the i = 6 to 100, but if it encounters a blank cell, simply go to the next cell.  Between 6 and 100 are several blank fields separating data groupings, but I need to be sure the all non-blank fields are used.  
With Worksheets("Datasource")
    For i = 6 To 15
        .Range(strColumnRange & i).Name = .Range(strColumnRangeText & i).Value
    Next
End With

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sandra Smith

ASKER

Yes that works.  Thank you again.  It has been a long time since I programmed Excel and your help has been signifcant on this project.  I normally program databases, but the client wants all this in Excel and it has been a challenge!