variable = current cell in VB

G

Guest

Trying to make the variable z equal to the cell previously found by the scrip

Sheets("Eclipse").Selec
Range("A1").Selec
Cells.Find(What:="time", After:=ActiveCell, LookIn:=xlFormulas, LookAt
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=
False).Activat
Cells.Find(What:="days", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
.Selec
z = Cells.Find(What:="days", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
.Selec
Cells(z + 1, "B").Valu

x = ActiveCell.Addres
Selection.End(xlDown).Selec
y = ActiveCell.Addres
Range(x, y).Selec
Application.CutCopyMode = Fals
Selection.Cop
Sheets("Sheet1").Selec
Range("B2").Selec
ActiveSheet.Paste
 
T

Tom Ogilvy

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

z.Select
 
G

Guest

When i try and run that code Tom it says that z is not defined properly, failed to provide a valid object qualifier.
 
T

Tom Ogilvy

Dim z as Range

--
Regards,
Tom Ogilvy

Tim said:
When i try and run that code Tom it says that z is not defined properly,
failed to provide a valid object qualifier.
 
B

Bob Phillips

Did you declare z as a range?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Tim said:
When i try and run that code Tom it says that z is not defined properly,
failed to provide a valid object qualifier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top