Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
How do I CALL the function below. Where do I place the code shown below And how do I go about calling the function Thanks Sub FindLastCell() Dim LastCell As Range With ActiveSheet Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) If IsEmpty(LastCell) Then 'do nothing Else Set LastCell = LastCell.Offset(1, 0) End If End With MsgBox LastCell.Row End Sub -- Norton Virus checker 2003 says this email is clean |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
go to the vbe and with your workbook as the active project, do
Insert=Module. Place the code there. You can create another macro to call it Sub CallDemo() Call FindLastCell() End Sub Regards, Tom Ogilvy "pcor" wrote in message le.rogers.com... Hi How do I CALL the function below. Where do I place the code shown below And how do I go about calling the function Thanks Sub FindLastCell() Dim LastCell As Range With ActiveSheet Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) If IsEmpty(LastCell) Then 'do nothing Else Set LastCell = LastCell.Offset(1, 0) End If End With MsgBox LastCell.Row End Sub -- Norton Virus checker 2003 says this email is clean |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was a great help. Thanks
Is there a way to action that same code without using a macro? "Tom Ogilvy" wrote in message ... go to the vbe and with your workbook as the active project, do Insert=Module. Place the code there. You can create another macro to call it Sub CallDemo() Call FindLastCell() End Sub Regards, Tom Ogilvy "pcor" wrote in message le.rogers.com... Hi How do I CALL the function below. Where do I place the code shown below And how do I go about calling the function Thanks Sub FindLastCell() Dim LastCell As Range With ActiveSheet Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) If IsEmpty(LastCell) Then 'do nothing Else Set LastCell = LastCell.Offset(1, 0) End If End With MsgBox LastCell.Row End Sub -- Norton Virus checker 2003 says this email is clean |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tools=Macro=Macros, select FindLastCell and hit the run button.
Regards, Tom Ogilvy "pcor" wrote in message e.rogers.com... That was a great help. Thanks Is there a way to action that same code without using a macro? "Tom Ogilvy" wrote in message ... go to the vbe and with your workbook as the active project, do Insert=Module. Place the code there. You can create another macro to call it Sub CallDemo() Call FindLastCell() End Sub Regards, Tom Ogilvy "pcor" wrote in message le.rogers.com... Hi How do I CALL the function below. Where do I place the code shown below And how do I go about calling the function Thanks Sub FindLastCell() Dim LastCell As Range With ActiveSheet Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) If IsEmpty(LastCell) Then 'do nothing Else Set LastCell = LastCell.Offset(1, 0) End If End With MsgBox LastCell.Row End Sub -- Norton Virus checker 2003 says this email is clean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calling Jim Cone - OFFSET Function | Excel Discussion (Misc queries) | |||
Calling a function in my SQL-DB from VBA | Excel Discussion (Misc queries) | |||
Calling function from a userform | Excel Discussion (Misc queries) | |||
Calling a function and then returning | Excel Discussion (Misc queries) | |||
calling a new function Excel gives me #NAME? | Excel Worksheet Functions |