Paste value into txt box from worksheet

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Evening,

I would like to put a code to a button to do the following,

Copy the cell value of E17
Open user form called Hondaparts
Paste the copied value into txt box called MyPartNumber
Then enter

The code i have so far is shown below but cant figure out the paste part,

Code:
Sub Macro9()'
' Macro9 Macro
'


'
    Range("E17").Select
    Selection.Copy
    HondaParts.Show
    MyPartNumber.Paste
End Sub

With this code i get the cell copied ^ user form open but then im stumped.
Can you please advise.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How about
Code:
Sub Macro9() '
    HondaParts.Show
    HondaParts.MyPartNumber.Value = Range("E17").Value
End Sub
 
Upvote 0
Try this:
Code:
Sub Macro9()
'Modified  7/12/2018  4:38:13 PM  EDT
HondaParts.MyPartNumber.Value = Range("E17").Value
HondaParts.Show
End Sub
 
Upvote 0
Many thanks.
This did the trick,
Code:
Sub Macro9()

HondaParts.MyPartNumber.Value = Range("E17").Value
HondaParts.Show

End Sub

On a side note that im thinking about.
I have a code which when i select a cell the row is changed to blue & the selected cell is changed to green.
I assume the green cell is the active cell ?

If so as opposed to the value in cell E17 mentioned above can we have the code run but the value in question to use would be the green selected cell ?

Just an after thought after my original post,of which im good at,Sorry.

Fluff when i tried your code it would not paste but thanks for your time.
 
Upvote 0
You said:
I have a code which when i select a cell the row is changed to blue & the selected cell is changed to green.

I would need to see this code:
 
Upvote 0
Try this:
Code:
Sub Macro9()
'Modified  7/12/2018  5:01:43 PM  EDT
HondaParts.MyPartNumber.Value = ActiveCell.Value
HondaParts.Show
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,749
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top