+ Reply to Thread
Results 1 to 4 of 4

Loop That Will Count Number Of Comments In a Column Between Empty Cells

  1. #1
    Registered User
    Join Date
    12-15-2015
    Location
    Regina, Saskatchewan, Canada
    MS-Off Ver
    2013
    Posts
    22

    Loop That Will Count Number Of Comments In a Column Between Empty Cells

    Good Afternoon All,

    I am wanting to write a macro that will loop and count the below comments, giving me their placement as there can be up to 9 comments. The comments are in Column U and I would count them in row T.

    So in the below example I would like it to put in the numbers beside the comments.

    1 Comment: OEM #1171022
    2 Comment: SALT CHAIN


    1 Comment: 41L SALT CHAIN CAN USE ON JD850C REMOVE 1 LINK.
    2 Comment: CAN USE 3P5927C CMACHAIN NOTEWL
    3 Comment: SALT CHAIN

    The blank cells are part numbers that do not have comments, as well as each part can have anywhere from 1 - 9 comments so it has to be able to adapt to those perameters. There will always be breaks between the comments as there is other data that forces the breaks.

    Any help at all would be greatly appreciated as I am out of my league on this one.

    Thank you.
    Last edited by M7A0S8T8E5R; 07-15-2016 at 06:04 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Loop That Will Count Number Of Comments In a Column Between Empty Cells

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-15-2015
    Location
    Regina, Saskatchewan, Canada
    MS-Off Ver
    2013
    Posts
    22

    Re: Loop That Will Count Number Of Comments In a Column Between Empty Cells

    Hey there,

    The upload link isn't working for me so the below is the best I can do. Does that help?

    Sorry!

    A B C D E F G H I J K L M N O P Q R S T U
    WH PN DESC BIN DI OH OO OFC ROP LT SS PIS OI NET LIST SLC COM C12 L12 COMMENTS
    1D 123456 D6H-R 41 TLA 0 0 5 0 0 0 1 2635.83 4393.04 00 2 0
    1D 123456 Comment: OEM #6I9671
    1D 456789 D6H-R 45 TLA YARD 0 0 7 1 0 0 1 2892.99 4821.65 00 4 2
    1D 456789 Comment: OEM #8E9037
    1D 456789 Comment: AVAILABLE ON ITR P/NCR55

  4. #4
    Registered User
    Join Date
    12-15-2015
    Location
    Regina, Saskatchewan, Canada
    MS-Off Ver
    2013
    Posts
    22

    Re: Loop That Will Count Number Of Comments In a Column Between Empty Cells

    That didn't work at all. Below is the code that I am using. I can find the items with data in the columns and can count place the 1 beside them. But if there are multiples in a row I would like them to count up (1,2,3) until there is a blank in Column U then the count would start over at the next cell that has data. Does the below help with figuring this problem out?

    Sub Macro1()
    '
    ' Macro1 Macro
    Dim endRow As Long
    Dim rangeOne As Range, rangeTwo As Range

    '
    endRow = Sheets("Report").Cells(Rows.Count, 1).End(xlUp).Row
    For i = 1 To endRow
    If Range("U" & i).Value <> "" Then
    Range("T" & i).Value = 1
    End If
    Next i
    '
    End Sub

+ 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. Replies: 5
    Last Post: 02-01-2016, 05:57 PM
  2. Replies: 10
    Last Post: 09-26-2015, 08:26 PM
  3. Find count of filled cells and empty cells in a column
    By thepinkgeologist in forum Excel General
    Replies: 4
    Last Post: 09-22-2015, 01:03 PM
  4. [SOLVED] Help! VBA on how to count empty cells in one column based on last row of another column
    By MG3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2015, 02:51 PM
  5. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  6. [SOLVED] Loop to find cells based on criteria, enter formula into next empty column
    By cschoyer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2012, 03:32 PM
  7. Count the number of cells in a range that are not empty
    By efernandes67 in forum Excel General
    Replies: 5
    Last Post: 07-23-2010, 05:41 AM

Tags for this Thread

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