Results 1 to 5 of 5

Code to loop through a column and change cell value based on list

Threaded View

  1. #3
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Code to loop through a column and change cell value based on list

    Hello,

    Please find working example in attached file.

    My solution is
    Private Sub CommandButton1_Click()
    'Author: MaczaQ
    'Thread: http://www.excelforum.com/excel-programming/792086-code-to-loop-through-a-column-and-change-cell-value-based-on-list.html
    
    Dim r As Integer
    r = 2
    
    
    Do Until Cells(r, "B").Value = ""
      Set f = Sheets("Conversion List").Range("A:A").Find(Cells(r, "B").Value)
      
      If Not f Is Nothing Then
          Cells(r, "B").Value = f.Cells(, 2).Value
      End If
      
      Set f = Nothing
      r = r + 1
    Loop
    End Sub
    Best Regards
    MaczaQ
    Attached Files Attached Files

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