Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I will try and explain this as best as I can but please forgive me if I fail.
I have a date range in row 2 starting in column e and runing through to cell IR2. I then have a list of tasks in column a staring in row 4. There is a command button linked to a macro that will insert a new task in the middle of the existing list of tasks and creates some subtotals etc but what I would like it also to do is remember the row the active cell is in, look up todays date in the range and move to that location ready for input. Any ideas please? Kind regards, Mav |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try the below
Sub Macro() Dim lngCol As Long 'your other code lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Application.Goto Cells(2, lngCol), True End Sub -- Jacob (MVP - Excel) "Maver1ck666" wrote: I will try and explain this as best as I can but please forgive me if I fail. I have a date range in row 2 starting in column e and runing through to cell IR2. I then have a list of tasks in column a staring in row 4. There is a command button linked to a macro that will insert a new task in the middle of the existing list of tasks and creates some subtotals etc but what I would like it also to do is remember the row the active cell is in, look up todays date in the range and move to that location ready for input. Any ideas please? Kind regards, Mav |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops...I missed the activecell Row....Try the modified one..
Sub Macro() Dim lngRow As Long, lngCol As Long lngRow = ActiveCell.Row 'your other code here lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Cells(lngRow, lngCol).Activate End Sub -- Jacob (MVP - Excel) "Jacob Skaria" wrote: Try the below Sub Macro() Dim lngCol As Long 'your other code lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Application.Goto Cells(2, lngCol), True End Sub -- Jacob (MVP - Excel) "Maver1ck666" wrote: I will try and explain this as best as I can but please forgive me if I fail. I have a date range in row 2 starting in column e and runing through to cell IR2. I then have a list of tasks in column a staring in row 4. There is a command button linked to a macro that will insert a new task in the middle of the existing list of tasks and creates some subtotals etc but what I would like it also to do is remember the row the active cell is in, look up todays date in the range and move to that location ready for input. Any ideas please? Kind regards, Mav |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent, cheers for that Jacob!
"Jacob Skaria" wrote: Oops...I missed the activecell Row....Try the modified one.. Sub Macro() Dim lngRow As Long, lngCol As Long lngRow = ActiveCell.Row 'your other code here lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Cells(lngRow, lngCol).Activate End Sub -- Jacob (MVP - Excel) "Jacob Skaria" wrote: Try the below Sub Macro() Dim lngCol As Long 'your other code lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Application.Goto Cells(2, lngCol), True End Sub -- Jacob (MVP - Excel) "Maver1ck666" wrote: I will try and explain this as best as I can but please forgive me if I fail. I have a date range in row 2 starting in column e and runing through to cell IR2. I then have a list of tasks in column a staring in row 4. There is a command button linked to a macro that will insert a new task in the middle of the existing list of tasks and creates some subtotals etc but what I would like it also to do is remember the row the active cell is in, look up todays date in the range and move to that location ready for input. Any ideas please? Kind regards, Mav |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just noticed; I have hardcoded the date...You can try the below..
Sub Macro() Dim lngRow As Long, lngCol As Long lngRow = ActiveCell.Row 'your other code here lngCol = Cells.Find(What:=Date, After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Cells(lngRow, lngCol).Activate End Sub -- Jacob (MVP - Excel) "Maver1ck666" wrote: Excellent, cheers for that Jacob! "Jacob Skaria" wrote: Oops...I missed the activecell Row....Try the modified one.. Sub Macro() Dim lngRow As Long, lngCol As Long lngRow = ActiveCell.Row 'your other code here lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Cells(lngRow, lngCol).Activate End Sub -- Jacob (MVP - Excel) "Jacob Skaria" wrote: Try the below Sub Macro() Dim lngCol As Long 'your other code lngCol = Cells.Find(What:="4/28/2010", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole).Column Application.Goto Cells(2, lngCol), True End Sub -- Jacob (MVP - Excel) "Maver1ck666" wrote: I will try and explain this as best as I can but please forgive me if I fail. I have a date range in row 2 starting in column e and runing through to cell IR2. I then have a list of tasks in column a staring in row 4. There is a command button linked to a macro that will insert a new task in the middle of the existing list of tasks and creates some subtotals etc but what I would like it also to do is remember the row the active cell is in, look up todays date in the range and move to that location ready for input. Any ideas please? Kind regards, Mav |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007: mouse cant find cell handle to drag/move | Excel Discussion (Misc queries) | |||
How to get date to move down to next cell & other referances, macr | Excel Discussion (Misc queries) | |||
Find text string and move contents to another cell | Excel Programming | |||
move two columns to the right and then find next cell above that i | Excel Programming | |||
Find text and move it to other cell | Excel Programming |