LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Set variable to a function

I am using user forms in a workbook that I am doing. When I click a button, I want it to move to a cell that I have selected, using a variable, "Loc" in the offset. Under the objects, in ThisWorkbook I have this code...

Sub Variables()
Dim Loc
Loc = CountA("B:B")
End Sub

When this tries to run it gives the error message
"Compile Error:
Sub of Function not Defined"
and it highlights CountA

I think I got this to work before, but I dont know what I did to make it work, but I lost some data when the program froze, so I dont have that part of the code anymore.
Can this be done, or did I just imagine it happening before? If it can be done, what do I need to do to make it work?

 
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
Variable Value Function Help? Jonathan Cheek[_2_] Excel Worksheet Functions 2 December 22nd 09 05:33 AM
Variable Sum Function David G. Excel Discussion (Misc queries) 9 December 29th 08 08:34 PM
Variable function ESP Tom Excel Discussion (Misc queries) 1 July 10th 06 09:37 PM
Variable function ESP Tom Excel Discussion (Misc queries) 2 July 10th 06 04:01 PM
Variable function ESP Tom Excel Discussion (Misc queries) 0 July 10th 06 02:15 PM


All times are GMT +1. The time now is 07:14 PM.

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

About Us

"It's about Microsoft Excel"