+ Reply to Thread
Results 1 to 5 of 5

LOOP.letter appears in one column if condition met in other column.

  1. #1
    Forum Contributor
    Join Date
    04-16-2016
    Location
    bognor
    MS-Off Ver
    Pro-Plus 2016
    Posts
    153

    LOOP.letter appears in one column if condition met in other column.

    Hello all,
    I have a spreadsheet consiting of twelve columns of data.(Columns A to L) The number of rows varies:
    Column H is populated with numbers.
    I would like to loop through and when the number 44 appears in column H, I would like to place the letter Y in the NEXT ROW DOWN in Column M

    So lets say in row 12 the number 44 appears in Col H,then the letter Y will in the next row down in Col 13(M).
    Any help appreciated
    Kind Regards
    BIF

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hello, try this !


    Why not just using a formula ?!

    Anyway an Excel basics VBA demonstration as a beginner starter :

    PHP Code: 
    Sub Demo1()
            
    Dim Rf As RangeR&
        
    With ActiveSheet.UsedRange.Columns(8)
            
    Set Rf = .Find(44, , xlValues1)
         If 
    Not Rf Is Nothing Then
            R 
    Rf.Row
         
    Do
                
    Rf(26) = "Y"
            
    Set Rf = .FindNext(Rf)
         
    Loop Until Rf.Row R
            Set Rf 
    Nothing
         End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    O365 V2408
    Posts
    15,177

    Re: LOOP.letter appears in one column if condition met in other column.

    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    04-16-2016
    Location
    bognor
    MS-Off Ver
    Pro-Plus 2016
    Posts
    153

    Re: LOOP.letter appears in one column if condition met in other column.

    Thanks to both Mark L and sintek for both solving the problem with different coding.Both examples worked perfectly.
    much appreciated and kind regards
    bif

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    O365 V2408
    Posts
    15,177

    Re: LOOP.letter appears in one column if condition met in other column.

    ..............................
    THANKS.gif

+ 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. [SOLVED] Return Column Letter based on condition
    By SteveTheFish in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-15-2019, 12:12 AM
  2. [SOLVED] Need VBA to find letter A in Column A:A, select range, popup MsgBox then loop
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-28-2015, 04:05 AM
  3. [SOLVED] HELP! Need to delete row ONLY if the letter N appears in BOTH column G and H
    By PLEASEHELPASAP in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-02-2012, 07:29 PM
  4. [SOLVED] find number of times a letter or a number appears in a column
    By dcoates in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2012, 02:47 PM
  5. Replies: 5
    Last Post: 07-05-2012, 04:04 PM
  6. Replies: 8
    Last Post: 07-05-2012, 03:07 PM
  7. Loop Column letter A to Z ??
    By al007 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-15-2005, 05:35 AM

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