PC Review


Reply
Thread Tools Rate Thread

command button code needed

 
 
pswanie
Guest
Posts: n/a
 
      3rd Jan 2008
i got the following code with a command button (thanx dan r.) it does put
the text that i enterd in the apropriate cells. so that part works. thanx

but now...
im thinking of adding a checkbox1. textbox1, textbox2 and textbox3 only
needs be visible when the tickbox1 has a tick in..

and if the commandbutton1 can close the userform aswell?

thanx

Private Sub CommandButton1_Click()
Dim lRow As Long, i As Integer
For i = 3 To 5
lRow = Cells(Rows.Count, i).End(xlUp).Row
Cells(lRow + 1, i) = Me.Controls("TextBox" & i - 2).Value
Next i
End Sub

 
Reply With Quote
 
 
 
 
Dan R.
Guest
Posts: n/a
 
      3rd Jan 2008
See this link:

http://support.microsoft.com/kb/829070

--
Dan

On Jan 3, 11:34*am, pswanie <pswa...@discussions.microsoft.com> wrote:
> i got the following code with a command button (thanx dan r.) *it does put
> the text that i enterd in *the apropriate cells. so that part works. thanx
>
> but now...
> im thinking of adding a checkbox1. *textbox1, textbox2 and textbox3 only
> needs be visible when the tickbox1 has a tick in..
>
> and if the commandbutton1 can close the userform aswell?
>
> thanx
>
> Private Sub CommandButton1_Click()
> * *Dim lRow As Long, i As Integer
> * *For i = 3 To 5
> * * * lRow = Cells(Rows.Count, i).End(xlUp).Row
> * * * Cells(lRow + 1, i) = Me.Controls("TextBox" & i - 2).Value
> * *Next i
> End Sub

 
Reply With Quote
 
pswanie
Guest
Posts: n/a
 
      3rd Jan 2008
thanx dan...

"Dan R." wrote:

> See this link:
>
> http://support.microsoft.com/kb/829070
>
> --
> Dan
>
> On Jan 3, 11:34 am, pswanie <pswa...@discussions.microsoft.com> wrote:
> > i got the following code with a command button (thanx dan r.) it does put
> > the text that i enterd in the apropriate cells. so that part works. thanx
> >
> > but now...
> > im thinking of adding a checkbox1. textbox1, textbox2 and textbox3 only
> > needs be visible when the tickbox1 has a tick in..
> >
> > and if the commandbutton1 can close the userform aswell?
> >
> > thanx
> >
> > Private Sub CommandButton1_Click()
> > Dim lRow As Long, i As Integer
> > For i = 3 To 5
> > lRow = Cells(Rows.Count, i).End(xlUp).Row
> > Cells(lRow + 1, i) = Me.Controls("TextBox" & i - 2).Value
> > Next i
> > End Sub

>

 
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
Help Needed for Assigning of Hot Key For a Command Button In acces TGV Microsoft Access Forms 1 16th May 2009 02:28 PM
Help needed! How use a Command Button to pop up a text box in Excel? matt@career-horizons.com Microsoft Excel Programming 2 11th Jul 2006 07:00 PM
Command button code needed to open specific form =?Utf-8?B?TWFyeSBBIFBlcmV6?= Microsoft Access Form Coding 5 2nd Mar 2006 03:44 AM
Help needed moving a command button Karoo News Microsoft Excel Programming 2 30th Jan 2006 04:18 AM
Re: Programming needed for command button Sue Mosher [MVP-Outlook] Microsoft Outlook Form Programming 2 23rd Mar 2004 07:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 PM.