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


I need a code for my command buttons in my userform.

I need one code that will allow me to input the info from cell 'B10'
into userform textbox 1

I need the seceond code to allow me to empty the contents of userform
textbox 2 into cell 'C10'

I do not want this to be on code I want to use a code for each
function.

Thank you for your support.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=468099

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default CommandButton Code

sub commandbutton1_click()

textbox1.text = range("B10").value

end sub

sub commandbutton2_click()

range("C10").value = textbox2.text
end sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default CommandButton Code

Private Sub CommandButton1_Click()

TextBox1.Value = Range("b10").Value
Range("c10") = TextBox2.Value

End Sub


--
EzMoney


"oberon.black" wrote:


I need a code for my command buttons in my userform.

I need one code that will allow me to input the info from cell 'B10'
into userform textbox 1

I need the seceond code to allow me to empty the contents of userform
textbox 2 into cell 'C10'

I do not want this to be on code I want to use a code for each
function.

Thank you for your support.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=468099


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default CommandButton Code


These codes work perfectly.

Now, I want to know if it is possible to empty the content of column
into a worksheet that as the same name as what is shown in column A.

example

I have 7 worksheets
worksheet 1 ------- which has the userform in it.
worksheet 2 ------- which is named after cell 'A10' in worksheet 1
worksheet 3 ------- which is named after cell 'A11' in worksheet 1
worksheet 4 ------- which is named after cell 'A12' in worksheet 1
worksheet 5 ------- which is named after cell 'A13' in worksheet 1
worksheet 6 ------- which is named after cell 'A14' in worksheet 1
worksheet 7 ------- which is named after cell 'A15' in worksheet 1

the userform
gets information from 'a10' and inserts that information into th
adjacent cell 'b10' and so on.

I would also like to have the information inserted in to the same cell
on the worksheet that is named after cell 'a10' and so on.

What code do I need to to this?

current code

Code
-------------------

Private Sub commandbutton1_click()
'get text
TextBox1.Text = Range("A4").Value
TextBox2.Text = Range("A5").Value
TextBox3.Text = Range("A6").Value
TextBox4.Text = Range("A7").Value
TextBox5.Text = Range("A8").Value

End Sub

Private Sub CommandButton2_Click()
'dump input
Range("B4").Value = TextBox6.Text
Range("B5").Value = TextBox7.Text
Range("B6").Value = TextBox8.Text
Range("B7").Value = TextBox9.Text
Range("B8").Value = TextBox10.Text

End Sub

-------------------

--
oberon.blac
-----------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...fo&userid=2673
View this thread: http://www.excelforum.com/showthread.php?threadid=46809

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
Can You Change A CommandButton Code Using A Macro? Donna[_7_] Excel Programming 4 February 11th 05 08:38 AM
CommandButton chris[_12_] Excel Programming 1 April 15th 04 01:01 AM
CommandButton rwebster3 Excel Programming 0 April 14th 04 08:16 PM
Commandbutton David Fixemer Excel Programming 2 February 25th 04 10:18 PM
Code runs different in a commandbutton than a macro why? Neal Miller Excel Programming 7 December 7th 03 02:41 AM


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