![]() |
Active cell plus 1
I want to set z as the active cell then have x equal to the active cell + 1 or the cell below, The z factor can be skipped if possible. My code i
Sub Macro3( ' Macro3 Macr ' Macro recorded 2/24/2004 by Husky Use Dim z As Rang 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 Set z = ActiveCel Cells(z + 1, "B").Select <--------------------error that you can not add a 1 to z 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.Past End Su |
Active cell plus 1
Tim,
Try Cells(z.Row + 1, "B").Select -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Tim" wrote in message ... I want to set z as the active cell then have x equal to the active cell + 1 or the cell below, The z factor can be skipped if possible. My code is Sub Macro3() ' ' Macro3 Macro ' Macro recorded 2/24/2004 by Husky User ' Dim z As Range 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 Set z = ActiveCell Cells(z + 1, "B").Select <--------------------error that you can not add a 1 to z 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 End Sub |
Active cell plus 1
Thanks chip, that seems to work.
|
All times are GMT +1. The time now is 10:49 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com