Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default is it possible to run code written inside a cell

Is it possible to run code written inside a cell, for example, cell A1
I wrote MsgBox "Hi i am David" When I run the code it has show the
message Hi i am David or else order written in A1 any help appreciated
in advance.
thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default is it possible to run code written inside a cell

Hi
Your example does not have any code written inside a cell, so hard to
know what you want. If you want to show the text in A1 in a msgbox you
could use

Function ShowIt(myCell as Range) as Variant
ShowIt = MsgBox(myCell.Value)
End function

and run the sub

Sub RunShowIt()
ShowIt Range("A1")
End Sub

If you really want to run code that is in A1 you will need to run a
sub which starts the code, which begs the question of why not put the
code in A1 into the original sub in the first place?
regards
Paul

On Apr 27, 8:27*am, EXCEL_LOVER wrote:
Is it possible to run code written inside a cell, for example, cell A1
I wrote MsgBox "Hi i am David" When I run the code it has show the
message Hi i am David or else order written in A1 any help appreciated
in advance.
thanks


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
Create .NET components written in C# inside Excel Macro Tom Chau Excel Discussion (Misc queries) 0 April 11th 06 07:10 AM
using the name of a worksheet written in a cell, inside a formula Using the name of a worksheet written in Excel Worksheet Functions 2 March 6th 06 10:29 PM
Running VBA Code not written within the currrent worksheet DMB Excel Programming 2 September 6th 05 05:58 PM
Programmely written code don't work Flemming Dahl[_2_] Excel Programming 8 March 1st 04 09:27 PM
Searching range for value (code written but needs 'tweaking'!) ian123[_26_] Excel Programming 8 December 23rd 03 05:19 PM


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