mole999
Well-known Member
- Joined
- Oct 23, 2004
- Messages
- 10,524
- Office Version
- 2019
- 2016
- 2013
- Platform
- Windows
I was provide this blindlingly fast filler (by Fluff)
I now have a stock control sheet that like a pivot only provides the first instance of a label until the type changes and needs to adapt what is done
So the area to check is down column B, I've processed the sheet to put the first label at B1 "LabelA", the next label LabelB appears at B198 so need to fill between B1 to B197, then do for the next label.
I get the last row value from C which currently 3754
would
If LCase(Rng.Offset(-1).Resize(1).Value) = "labelA" Then Rng.Value = "LabelA"
If LCase(Rng.Offset(-1).Resize(1).Value) = "labelB" Then Rng.Value = "LabelB"
be efficient (subject to no new labels added)? I think I can kludge it but that's not ideal, any tweaks?
Code:
Sub Mole999()
Dim Rng As Range
For Each Rng In Range("Y:Y").SpecialCells(xlBlanks).Areas
If LCase(Rng.Offset(-1).Resize(1).Value) = "on" Then Rng.Value = "ON"
Next Rng
End Sub
I now have a stock control sheet that like a pivot only provides the first instance of a label until the type changes and needs to adapt what is done
So the area to check is down column B, I've processed the sheet to put the first label at B1 "LabelA", the next label LabelB appears at B198 so need to fill between B1 to B197, then do for the next label.
I get the last row value from C which currently 3754
would
If LCase(Rng.Offset(-1).Resize(1).Value) = "labelA" Then Rng.Value = "LabelA"
If LCase(Rng.Offset(-1).Resize(1).Value) = "labelB" Then Rng.Value = "LabelB"
be efficient (subject to no new labels added)? I think I can kludge it but that's not ideal, any tweaks?