Filtering and replacing values through a macro

V

vic

Coding Help!

I have spreadsheet where column A is company, column B is user, and column C
is area.

If column A, Row1 equals 18 and Column C, Row 1 equals "FLA" then Column B
row 1 is replace with "BILL". I want it to continue until it reaches the
last row.

Thanks for your help!!!!!
 
J

Jason Morin

In a standard module:

Sub InsertBill()
Dim cell As Range
Dim ActiveWS As Worksheet
Dim iLastRow As Long
Set ActiveWS = ActiveWorkbook.ActiveSheet
iLastRow = Cells(Rows.Count, 1).End(xlUp).Row
For Each cell In ActiveWS.Range("A1:A" & iLastRow)
With cell
If .Value = 18 And _
.Offset(0, 2).Value = "FLA" Then
.Offset(0, 1).Value = "Bill"
End If
End With
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top