fill down to next change in value
Sandi, this should do what you want, as long as there are
no empty cells in column C
Sub c()
Dim rngCell As Range
Dim lngLastNum As Long
Set rngCell = Range("C1")
lngLastNum = CLng(rngCell.Value)
While Not IsEmpty(rngCell)
If IsNumeric(rngCell.Value) Then
lngLastNum = rngCell.Value
Else
rngCell.Value = lngLastNum
End If
Set rngCell = rngCell.Offset(1)
Wend
End Sub
Rgds
Rog
-----Original Message-----
(i certainly hope there is no limit as to the number of
questions one can
ask! - so here we go again!)
below is a snipet of my database (note database is
currently at 1000 records
or so, and can vary in length):
COL A COL B COLUMN
C COLUMN D
----------------------------------------------------------
-----------------
SEQ: T ERRI 42010107
FALSE
200203 21 EXCHANGE RATE:
1.588 88,395.18
200204 22 EXCHANGE RATE:
1.582 89,873.48
200205 22 EXCHANGE RATE:
1.551 90,590.98
SEQ: T ERRI 42010108
FALSE
200203 21 EXCHANGE RATE:
1.588 88,395.18
200204 22 EXCHANGE RATE:
1.582 89,873.48
200205 22 EXCHANGE RATE:
1.551 90,590.98
SEQ: T ERRI 42010109
FALSE
200203 21 EXCHANGE RATE:
1.588 88,395.18
200204 22 EXCHANGE RATE:
1.582 89,873.48
200205 22 EXCHANGE RATE:
1.551 90,590.98
COLUMN C is currently formatted in "general" format...i
could change to
NUMBER format if req'd...
my goal is to replace the "exchange rate:....." text with
the territory
numbers (ie..42010107, 42010108, 42010109)
i am looking for some code that will, for example,
- carry down the 42010107 until it reaches the next
number (ie..42010108)
- then carry down the next number (42010108) until it
reaches the next
number (42010109)
- then carry down the next number (42010109) until it
reaches the next
number
- until the end, where there is no values
i want to replace the text "EXCHANGE RATE:" with the, in
this case,
territory numbers (eg. 42010107, 42010108, 42010109)
i only hope i am explaining this in a manner with which
you seasoned
professionals can understand!!
oh - and keep in mind, my vba skills are at beginner
level at best!
appreciate any assistance you can provide...
thanks..sandi
.
|