Results 1 to 13 of 13

TC Counter -- identify and count number of instances in a selected column.

Threaded View

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Question TC Counter -- identify and count number of instances in a selected column.

    Hello,

    I am trying to creat a VBA macro to locate cells in a manually selected column that have the text value "TC" and if this value is found then the cell value will be changed to TC1, then TC2, TC3, TC4, etc... (up to a max count of 1024).

    I'm starting out small (beginner to VBA) and trying to get TC to increment across a small population of a predefined column. This is what I have so far (though each of the 66 TC values in the column are renamed TC1 and do not increment):

    Sub TC_Count()
    
    
    For N = 1 To 66
    For Count = 1 To 66
    
        If Range("C" & N).Value = "TC" Then
    
                Range("C" & N).Select
                ActiveCell.Value = ActiveCell.Text & Count
    
    
            Else
        
        End If
        
    
    Next Count
    Next N
    
    End Sub
    Any help is appreciated. Thank you.
    Last edited by Cutter; 10-17-2012 at 03:56 PM. Reason: Added code tags

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