Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
vic
 
Posts: n/a
Default Filtering and replacing values through a macro

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!!!!!
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

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


---
HTH
Jason
Atlanta, GA

-----Original Message-----
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!!!!!
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"