Re: Set up an If Macro
- From: Wilson <Wilson@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Aug 2008 07:31:01 -0700
"Roger Govier" wrote:
Hi
Sub Fillblanks()
Dim lr As Long
Rows("1:1").Insert Shift:=xlDown
lr = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:B1").AutoFilter
Selection.AutoFilter Field:=2, Criteria1:="="
Range("B2:B" & lr) = "Not ATT"
Rows("1:1").Delete
End Sub
Copy code above
Alt+F11 to invoke VB Editor
Insert>Module
Paste code into white pane that appears
Alt+F11 to rturn to Excel
To use
Alt+F8
Select macro Fillblanks>Run
--
Regards
Roger Govier
"Melissa" <Melissa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6BC60917-027D-417D-853F-AC41C5D66AE5@xxxxxxxxxxxxxxxx
Trying to write a macro to fill in the blank spots in column B. So if B2 =
"" Then "Not ATT" if cell is not blank then skip cell, retain data and
move
to the next and keep processing until all data reviewed.
A B
1 John Smith ATT
2 Tom Jones
3 Jane Henry DNS
Roger -
How would I need to change the macro if I wanted to get the cell populated
with the data from the last field that it found was populated... for example:
I have the following data:
A | B
10 |
| Adam
| Mike
| John
12 |
| Stan
| Frank
and I want:
10 |
10 | Adam
10 | Mike
10 | John
12 |
12 | Stan
12 | Frank
I could obviously just drag down, but there are just too many.
THanks,
.
- Follow-Ups:
- Re: Set up an If Macro
- From: Roger Govier
- Re: Set up an If Macro
- Prev by Date: RE: Change cell format from text to general on the fly
- Next by Date: How to display full file path name in Excel 2007
- Previous by thread: VBA code
- Next by thread: Re: Set up an If Macro
- Index(es):
Relevant Pages
|