Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Accessing Mutiple TextBoxes


Hi,

I`m simply trying to export the text out of Multuple TextBoxes on
differnt Excel Worksheets in an ACCESS DB. This works fine as long as
I address only one TextBox:

Dim Text as String ' Temporary text Storage
Dim TableName as String ' Name of Tabel I want to access

' Name of TextBox1 = Comment

Text = Worksheets(TableName).Comment.Text

I have a List of all of the TextBox Names and now wanted to loop
through then always writing the content into the temporary String
"Text" and then export the Data. How can I address/access the text in
different TextBoxes during runtime ? The Item funktion doesn`t work:
e.g

Dim TextBoxName as String ' name of the TextBox I want to access

Text = Worksheets(TableName).Item(TextBoxName).Text

Thanx in advance for your help
Tim


--
TimBro
------------------------------------------------------------------------
TimBro's Profile: http://www.excelforum.com/member.php...o&userid=14912
View this thread: http://www.excelforum.com/showthread...hreadid=265419

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Accessing Mutiple TextBoxes

Hi Tim,

Just for ideas, assumes Textboxes from the drawing toolbar:

Sub Test()
Dim tbArr() As String, i As Long
Dim ws As Worksheet
Set ws = ActiveSheet
For Each ws In ActiveWorkbook.Worksheets
If getText(tbArr, ws) Then
Debug.Print ws.Name
For i = 1 To UBound(tbArr)
Debug.Print tbArr(i, 1), tbArr(i, 2) 'Ctrl G
Next
End If
Next
End Sub

Function getText(Arr, ws As Worksheet) As Boolean
Dim tb As TextBox, n As Long
n = ws.TextBoxes.Count
If n = 0 Then Exit Function
getText = True
ReDim Arr(1 To n, 2)
n = 0
For Each tb In ws.TextBoxes
n = n + 1

Arr(n, 1) = tb.Name
Arr(n, 2) = tb.Text
Next

End Function

Regards,
Peter

-----Original Message-----

Hi,

I`m simply trying to export the text out of Multuple

TextBoxes on
differnt Excel Worksheets in an ACCESS DB. This works

fine as long as
I address only one TextBox:

Dim Text as String ' Temporary text Storage
Dim TableName as String ' Name of Tabel I want to

access

' Name of TextBox1 = Comment

Text = Worksheets(TableName).Comment.Text

I have a List of all of the TextBox Names and now wanted

to loop
through then always writing the content into the

temporary String
"Text" and then export the Data. How can I

address/access the text in
different TextBoxes during runtime ? The Item funktion

doesn`t work:
e.g

Dim TextBoxName as String ' name of the TextBox I

want to access

Text = Worksheets(TableName).Item(TextBoxName).Text

Thanx in advance for your help
Tim


--
TimBro
----------------------------------------------------------

--------------
TimBro's Profile: http://www.excelforum.com/member.php?

action=getinfo&userid=14912
View this thread:

http://www.excelforum.com/showthread...hreadid=265419

.

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
Running mutiple excel sheets on mutiple computers Lost Excel Discussion (Misc queries) 3 January 16th 09 12:32 AM
Textboxes SAL Excel Discussion (Misc queries) 2 July 13th 07 12:24 AM
tab between several textboxes Kim Excel Worksheet Functions 0 May 9th 05 04:08 PM
Textboxes Marcotte A Excel Programming 2 July 7th 04 12:55 AM
textboxes libby Excel Programming 5 April 13th 04 06:32 PM


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