variable = current cell in VB  
Author Message
efvail





PostPosted: Tue Feb 24 08:08:20 CST 2004 Top

Excel Programming >> variable = current cell in VB

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

Excel430  
 
 
Tom





PostPosted: Tue Feb 24 08:08:20 CST 2004 Top

Excel Programming >> 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





> 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


 
 
anonymous





PostPosted: Tue Feb 24 08:31:08 CST 2004 Top

Excel Programming >> variable = current cell in VB Thanks Tom
 
 
anonymous





PostPosted: Tue Feb 24 08:41:08 CST 2004 Top

Excel Programming >> variable = current cell in VB When i try and run that code Tom it says that z is not defined properly, failed to provide a valid object qualifier.
 
 
Tom





PostPosted: Tue Feb 24 09:02:06 CST 2004 Top

Excel Programming >> variable = current cell in VB Dim z as Range

--
Regards,
Tom Ogilvy



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


 
 
Bob





PostPosted: Tue Feb 24 09:17:15 CST 2004 Top

Excel Programming >> variable = current cell in VB 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)



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