PC Review


Reply
Thread Tools Rate Thread

can't transfer to worksheet

 
 
stewart
Guest
Posts: n/a
 
      13th Sep 2007
I have the following code that inputs a specified number of textboxes
based on the users input in another textbox. I am having trouble
passing info from the created textboxes to a worksheet. When I try to
run the code it comes up with object required. I tried the code with
a textbox that is put there at design time and it works fine. Please
help me.

'code to create boxes
sub
For i = 1 To txtQty.Value Step 1

With Me.Controls.Add("Forms.textbox.1")
.Top = 115 + (17 * i)
.Left = 20
.Height = 17
.Width = 50
.Name = "txtNum" & i
End With
Next i
end sub

'code to transfer data
Private Sub CommandButton1_Click()

ActiveSheet.Range("a1") = txtNum1.Value
End Sub

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      13th Sep 2007
ActiveSheet.Range("a1") = Me.Controls("txtNum1").Value

stewart wrote:
>
> I have the following code that inputs a specified number of textboxes
> based on the users input in another textbox. I am having trouble
> passing info from the created textboxes to a worksheet. When I try to
> run the code it comes up with object required. I tried the code with
> a textbox that is put there at design time and it works fine. Please
> help me.
>
> 'code to create boxes
> sub
> For i = 1 To txtQty.Value Step 1
>
> With Me.Controls.Add("Forms.textbox.1")
> .Top = 115 + (17 * i)
> .Left = 20
> .Height = 17
> .Width = 50
> .Name = "txtNum" & i
> End With
> Next i
> end sub
>
> 'code to transfer data
> Private Sub CommandButton1_Click()
>
> ActiveSheet.Range("a1") = txtNum1.Value
> End Sub


--

Dave Peterson
 
Reply With Quote
 
stewart
Guest
Posts: n/a
 
      13th Sep 2007
On Sep 12, 9:33 pm, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> ActiveSheet.Range("a1") = Me.Controls("txtNum1").Value
>
>
>
> stewart wrote:
>
> > I have the following code that inputs a specified number of textboxes
> > based on the users input in another textbox. I am having trouble
> > passing info from the created textboxes to a worksheet. When I try to
> > run the code it comes up with object required. I tried the code with
> > a textbox that is put there at design time and it works fine. Please
> > help me.

>
> > 'code to create boxes
> > sub
> > For i = 1 To txtQty.Value Step 1

>
> > With Me.Controls.Add("Forms.textbox.1")
> > .Top = 115 + (17 * i)
> > .Left = 20
> > .Height = 17
> > .Width = 50
> > .Name = "txtNum" & i
> > End With
> > Next i
> > end sub

>
> > 'code to transfer data
> > Private Sub CommandButton1_Click()

>
> > ActiveSheet.Range("a1") = txtNum1.Value
> > End Sub

>
> --
>
> Dave Peterson


Bingo...Thanks again

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and TRansfer from another Tab in same Worksheet davie670 Microsoft Excel Misc 3 13th Mar 2010 01:33 PM
transfer data from worksheet to another dave Microsoft Excel Misc 1 4th Sep 2008 06:14 AM
Transfer entities from rows/column of one worksheet to another worksheet Thulasiram Microsoft Excel Programming 0 26th Jul 2006 11:30 PM
transfer one worksheet to another worksheet without losing format. =?Utf-8?B?VHdpenRpZEtpdHRlbg==?= Microsoft Excel Worksheet Functions 1 18th Aug 2005 09:49 PM
Text from worksheet transfer to another Djanvk Microsoft Excel Worksheet Functions 2 14th Oct 2003 10:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:32 PM.