Results 1 to 1 of 1

VBA Code - multiple cell loop to txtbox Question/Problem

Threaded View

  1. #1
    Registered User
    Join Date
    01-05-2012
    Location
    Dublin, OH
    MS-Off Ver
    Excel 2003
    Posts
    1

    VBA Code - multiple cell loop to txtbox Question/Problem

    Hello -

    I'm using the following code:
    Dim C As Integer
    Dim Comments As String
    Dim CommentString As String
    Dim TotalComments As String
    
    ActiveCell.Offset(0, 29).Activate
    C = 0
    CommentString = "Comments Begin:"
    
    Do
        If IsEmpty(ActiveCell) = False Then
            
            Comments = ActiveCell.Value
            TotalComments = CommentString & vbNewLine & Comments
            CommentString = TotalComments
            C = C + 1
            ActiveCell.Offset(0, C).Select
            
            
       End If
     Loop Until IsEmpty(ActiveCell) = True
    
    txtComments.Value = TotalComments
    But for some reason the text box (txtComments) only displays the 1st, 2nd, 4th, 7th, 11th, 16th (and continuing in series) entries.

    I'm afraid I've baffled myself, can someone point out what I'm doing wrong?

    ***
    Removing the "c" variable fixed this. Not sure why.
    Last edited by IanZernechel; 01-06-2012 at 11:51 AM. Reason: Solved

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