Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Excel VBA - Text Boxes

Hi,

I am trying to copy all the contents of some text boxes
that appear on a worksheet on to a seperate worksheet but
without much luck.

I am trying to use a for each loop but cannot get it to
work when I need it to refernece the text boxes
individually.

Can anyone help me?

Many thanks
KD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel VBA - Text Boxes

for ActiveX textboxes

dim tbox as MSforms.Textbox
dim obj as OleObject
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.Textbox then
set tbox = obj.Object
' now work with your textbox
end if
Next

for Textboxes from the drawing toolbar

dim tbox as Textbox
for each tbox in Activesheet.Textboxes
' now work with your textboxes
Next

--
Regards,
Tom Ogilvy


"KD" wrote in message
...
Hi,

I am trying to copy all the contents of some text boxes
that appear on a worksheet on to a seperate worksheet but
without much luck.

I am trying to use a for each loop but cannot get it to
work when I need it to refernece the text boxes
individually.

Can anyone help me?

Many thanks
KD



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
Default font for pasted text in text boxes - Excel 2007 MS OFFICE USER EIT Excel Discussion (Misc queries) 0 March 25th 10 09:01 PM
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
Text Boxes Do Not Print In Excel mel6 Excel Discussion (Misc queries) 0 March 5th 09 06:42 PM
How to Import Visio Text Boxes into Excel as Text Nick_adminator Excel Discussion (Misc queries) 2 December 12th 07 05:56 AM
In Excel, option to enter text in cells the same as text boxes RobGMU Excel Worksheet Functions 0 October 26th 05 04:20 PM


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