View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default variable = current cell in VB

set z = Cells.Find(What:="days", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False)

z.Select



"Tim" wrote in message
...
Trying to make the variable z equal to the cell previously found by the

script

Sheets("Eclipse").Select
Range("A1").Select
Cells.Find(What:="time", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,

MatchCase:= _
False).Activate
Cells.Find(What:="days", After:=ActiveCell, LookIn:=xlFormulas,

LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,

MatchCase:=False) _
.Select
z = Cells.Find(What:="days", After:=ActiveCell, LookIn:=xlFormulas,

LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,

MatchCase:=False) _
.Select
Cells(z + 1, "B").Value

x = ActiveCell.Address
Selection.End(xlDown).Select
y = ActiveCell.Address
Range(x, y).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("B2").Select
ActiveSheet.Paste