Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DMB DMB is offline
external usenet poster
 
Posts: 14
Default Excel and VBA how to call a procedure from an excel "cell"

Is there a way to call a procedure that I have already written in vba from a
cell. For instance, can I put something like the following into a cell

Call CopyFunctionToAdjacentCell()


This is the VBA Code that I am using right now. It works great. If I could
only cut and paste it into the cell I would be set.
Cells(4 + StartRow, 4) = "'" & Cells(4 + StartRow, 2).Formula

Is thee a way to accomplish the same thing within Excel?
=A1.Formula ???

Problem is that I always get the result on the equation.

  #2   Report Post  
Posted to microsoft.public.excel.programming
DMB DMB is offline
external usenet poster
 
Posts: 14
Default Excel and VBA how to call a procedure from an excel "cell"


I also need to perform other worksheet maintence from with in Excel. Such
as, Changing all the headers for all the worksheets within the current
workbook of which there are 5.

Is there a way to perform these kind of things or is this a useless quest. I
am trying to make an application that the company owner will be able to
understand. He will never understand the VBA stuff. He doesn't even
understand most of the excel stuff. He needs to be able to work on these
functions later or the whole project will be scrap.

When I leave I don't want to go back. And I hope that he is still happy and
up and runnng.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Excel and VBA how to call a procedure from an excel "cell"

You can do it if your VBA code is a function. If you can somehow enclose
your code in a UDF, then the UDF can be used in the woorkshhet.


See my posting earlier today w.r.t. Using VBA Functions in a worksheet.
--
Gary''s Student


"DMB" wrote:

Is there a way to call a procedure that I have already written in vba from a
cell. For instance, can I put something like the following into a cell

Call CopyFunctionToAdjacentCell()


This is the VBA Code that I am using right now. It works great. If I could
only cut and paste it into the cell I would be set.
Cells(4 + StartRow, 4) = "'" & Cells(4 + StartRow, 2).Formula

Is thee a way to accomplish the same thing within Excel?
=A1.Formula ???

Problem is that I always get the result on the equation.

  #4   Report Post  
Posted to microsoft.public.excel.programming
DMB DMB is offline
external usenet poster
 
Posts: 14
Default Excel and VBA how to call a procedure from an excel "cell"

Hey thanks for the information. But! I can find the insert function dialog
box but I can't find out how to insert and write functions Am I supposed to
do that in the VBA environment?

Thanks, You must have a million questions to answer!



"Gary''s Student" wrote:

You can do it if your VBA code is a function. If you can somehow enclose
your code in a UDF, then the UDF can be used in the woorkshhet.


See my posting earlier today w.r.t. Using VBA Functions in a worksheet.
--
Gary''s Student


"DMB" wrote:

Is there a way to call a procedure that I have already written in vba from a
cell. For instance, can I put something like the following into a cell

Call CopyFunctionToAdjacentCell()


This is the VBA Code that I am using right now. It works great. If I could
only cut and paste it into the cell I would be set.
Cells(4 + StartRow, 4) = "'" & Cells(4 + StartRow, 2).Formula

Is thee a way to accomplish the same thing within Excel?
=A1.Formula ???

Problem is that I always get the result on the equation.

Reply
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
convert "15000" to "Fifteen thousand" in excel cell? anurag Excel Worksheet Functions 1 May 4th 06 07:58 AM
how can I make an excel cell "mark" or "unmark" when clicked on? Rick Excel Discussion (Misc queries) 6 January 8th 06 10:15 PM
bizarre "invalid procedure call" error PatFinegan[_14_] Excel Programming 11 July 13th 04 07:56 PM


All times are GMT +1. The time now is 12:12 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"