LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calling a function from within EXCEL

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








 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Jim Cone - OFFSET Function Lynda Excel Discussion (Misc queries) 0 May 28th 09 01:00 PM
Calling a function in my SQL-DB from VBA KSor Excel Discussion (Misc queries) 0 March 11th 09 02:08 PM
Calling function from a userform Jeff Excel Discussion (Misc queries) 0 September 27th 06 03:27 PM
Calling a function and then returning CLamar Excel Discussion (Misc queries) 4 June 19th 06 06:47 PM
calling a new function Excel gives me #NAME? Mark Dvorkin Excel Worksheet Functions 4 July 10th 05 01:29 AM


All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"