Sunday, October 25, 2015

VBA Find

If you have some data in Excel you want to retrieve in VBA under an Array, just use the "=" sign:

Set c=Worksheets(1).Range("a1:a500").Find(2, lookin:=xlValues) 
If Not c Is Nothing Then firstAddress = c.Address Do c.Value = 5 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address <> firstAddress End If End With



Created by DoMyExcel.com © | Excel & VBA Consulting | Customized Excel Solutions starting at 29 USD
Services provided to Individuals and Businesses | Free Quote: DoMyExcel@gmail.com

No comments:

Post a Comment