Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Changing a formula inside a textbox - Excel 2007

I am trying to find a way to change and view the formula inside a
textbox on a worksheet using VBA within Excel 2007.

In 2003 I use:

strButtonFormula = wsSheet.TextBoxes(strButtonName).Formula

and

wsSheet.TextBoxes(strButtonName).Formula = "=A1"

Nice and easy, and I have no issues.


However in 2007 - it doesn't like this code, and I can't find a way to
use "shapes" to get the same thing. I can get the text (i.e.
wsSheet.Shapes(strButtonName).TextFrame.Characters .Text), but not the
formula.

Also, when I record a macro in 2007, I get "ActiveCell.FormulaR1C1 =
"R1C1"", however this just doesn't work - it changes the last selected
cell, not the textbox!

Any ideas?????
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Changing a formula inside a textbox - Excel 2007

When I try:

strButtonFormula = wsSheet.TextBoxes(strButtonName).Formula

I get

"run-time error '1004'
Unable to get the TextBoxes property of the Worksheet class"

(Both variables are declared as strings)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Changing a formula inside a textbox - Excel 2007

Do I need to simply add a reference?
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
Fix for the slow opening of excel 2007 (Fix inside) [email protected] Excel Discussion (Misc queries) 1 September 18th 08 01:38 AM
Excel 2007 Broken Links - Box With a Question Mark on the Inside [email protected] Links and Linking in Excel 0 June 8th 07 01:33 AM
Changing the textbox value without changing the textbox format? Ozgur Pars[_2_] Excel Programming 2 September 8th 06 06:41 AM
Excel 2003, can't setfocus in a textbox inside a multipage, tab key don work! carlosla Excel Programming 0 February 23rd 06 07:55 PM
Create a mask inside a textbox dok112[_42_] Excel Programming 1 September 17th 05 12:45 AM


All times are GMT +1. The time now is 09:34 PM.

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"