Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Those little dots are important. Close doesn't count. <g "Rows.Count" returns the number of rows on the worksheet. "Range("RANGEMAT").Rows.Count" returns the number of rows in the range. "Replace" won't work on empty cells. The first example uses an "x" as the item to replace. The second example just adds the text to the cells... '------------------ Sub FirstTry() With Range("RANGEMAT") .Offset(1, 0).Resize(.Rows.Count - 2, 1).Replace What:="x", _ Replacement:="Check", LookAt:=xlPart, _ SearchOrder:=xlByColumns, MatchCase:=False End With End Sub '-------------------- Sub SecondTry() With Range("RANGEMAT") .Offset(1, 0).Resize(.Rows.Count - 2, 1).Value = "Check" End With End Sub ------------ Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Gerry Cornell" wrote in message Jim or any other kind soul who can help Trying to modify Jim's suggestion has hit problems Range("RANGEMAT").Select Range ("RANGEMAT").Offset(1,0).Resize(Rows.Count - 2, 1) Selection.Replace What:="", Replacement:="Check", LookAt:= _ xlPart, SearchOrder:=xlByColumns, MatchCase:=False Each time I try to correct Line 2 it throws up another problem. I haven't got as far as testing Line 3 and 4. Line 2 is intended to omit the first and last cell in the Range "RANGEMAT" and line 3 and 4 to enter the word Check in each cell in RANGEMAT except the first and last cells. TIA -- ~~~~ Gerry ~~~~~~~~ Enquire, plan and execute. Stourport, England ~~~~~~~~~~~~~~~~~ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional format range set-up in Excel 2000 | Excel Worksheet Functions | |||
allow users to edit a range in excel 2000 | Excel Discussion (Misc queries) | |||
Excel 2000 VBA - Set Print Range in dynamic range | Excel Programming | |||
Excel 2000 VBA - Selecting populated range | Excel Programming | |||
SOS:Know Deleted/Inserted Range in Excel 97/2000 | Excel Programming |