Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Form TextBox Transfer to Spreadsheet


I have a Form with multiple text boxes that I want to transfer to th
spreadsheet once the form is filled out. I've used the following macr
but it gets hung up.

Private Sub cmdClose_Click()
Dim i As Integer
Dim myNail(84)
Dim TextBox(84)
For i = 0 To 84

Sheets("Haven OSAS").Select
Range("C" & i + 1).Select
Selection = TextBox(i).Value * Here is where it get
stuck
Next i
Unload Me
Sheets("Haven ME").Select

Range("A1").Select

End Sub

It doesn't recognize the TextBox(i).Value and stops the macro. If
put in TextBox1.Value it works but I need to do this 85 times an
trying to save time

--
Excellan
-----------------------------------------------------------------------
Excellant's Profile: http://www.excelforum.com/member.php...fo&userid=2896
View this thread: http://www.excelforum.com/showthread.php?threadid=48690

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Form TextBox Transfer to Spreadsheet

Selection = me.controls("TextBox" & i+1).Value

Assumes by Form you mean Userform and the textboxes are named Textboxes are
named line TextBox1.

If the textboxes are on a sheet.

Selection = Worksheets("Data Entry").OleObjects("Textbox" & i +
1).Object.Value

--
Regards,
Tom Ogilvy

"Excellant" wrote
in message ...

I have a Form with multiple text boxes that I want to transfer to the
spreadsheet once the form is filled out. I've used the following macro
but it gets hung up.

Private Sub cmdClose_Click()
Dim i As Integer
Dim myNail(84)
Dim TextBox(84)
For i = 0 To 84

Sheets("Haven OSAS").Select
Range("C" & i + 1).Select
Selection = TextBox(i).Value * Here is where it gets
stuck
Next i
Unload Me
Sheets("Haven ME").Select

Range("A1").Select

End Sub

It doesn't recognize the TextBox(i).Value and stops the macro. If I
put in TextBox1.Value it works but I need to do this 85 times and
trying to save time.


--
Excellant
------------------------------------------------------------------------
Excellant's Profile:

http://www.excelforum.com/member.php...o&userid=28963
View this thread: http://www.excelforum.com/showthread...hreadid=486909



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Form TextBox Transfer to Spreadsheet


Thank you for a prompt response. I changed it and it worked like a
charm. :)


--
Excellant
------------------------------------------------------------------------
Excellant's Profile: http://www.excelforum.com/member.php...o&userid=28963
View this thread: http://www.excelforum.com/showthread...hreadid=486909

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
Transfer variable to user Form jlclyde Excel Discussion (Misc queries) 2 April 23rd 10 08:25 PM
transfer data from excel form to a spreadsheet Jeff[_11_] Excel Discussion (Misc queries) 0 March 13th 08 05:13 PM
Form Information transfer to a specific record LT Excel Discussion (Misc queries) 1 March 6th 07 06:29 PM
Transfer data to form from Excel range upon loading of form. Rob Crawford Excel Programming 2 October 24th 05 03:59 PM
Form 2 Form data transfer Madduck Excel Programming 4 August 23rd 05 11:20 PM


All times are GMT +1. The time now is 11:54 AM.

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"