Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Creating several TextBoxes (Shapes) with cell references as contents

Dear Experts:

below macro grabs the contents of cell B7 and displays it in a text
box (shape, not a control!). The formula is a cell reference so that
the text box contents is updated whenever the respective cell changes
its contents.

I would like to have the macro expanded so that several input boxes
are created with the following requirements:

1. An input box prompts the user to enter a number: this number
represents the iterations / number of text boxes to be created, say
the user has entered the number 5

2. another input box prompts the user to enter the first cell
reference, say B7.

Now the macro should do the following:

1. Iterate thru the macro 5 times
2. The formula part is to change as follows with each loop: the row
number of the cell reference is incremented by 1 with each loop, ie.
B7, B8, B9, B10, B11.
3. All in all: 5 text boxes are to be created with their respective
cell references

Hope this does not exceed the scope of this forum.

Help is much appreciated. Thank you very much in advance. Regards,
Andreas


Sub AddTextBox()
Dim shp As Shape
Set shp = ActiveSheet.Shapes.AddTextBox( _
msoTextOrientationHorizontal, 97.5, 28.5, 96.75, 17.25)
shp.DrawingObject.Formula = "B7"
With shp.TextFrame.Characters.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
End With

End Sub


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
Shapes: identifying different types (charts, textboxes, pictures e David Macdonald Excel Programming 4 November 11th 09 02:38 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
Problem - Shapes.Textboxes JMay Excel Discussion (Misc queries) 2 April 22nd 07 10:28 PM
Excel VBA - Remove Shapes and Cell Contents rick6823 Excel Programming 1 April 11th 04 10:50 PM
Excel VBA - Clearing Shapes and Cell Contents Rick[_19_] Excel Programming 2 April 10th 04 12:26 AM


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