• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Textbox value in selected cells

S P P

Member
Textbox value in selected cells

Exemple
 

Attachments

  • Textbox value in selected cells.xlsm
    16.8 KB · Views: 10
On the contrary

>>> use - code tags <<<
Code:
ActiveCell.Value = TextBox1
ActiveCell.Offset(1, 0).Value = TextBox2 =
 
Last edited by a moderator:
I got it like this

>>> use - code tags <<<
Code:
Private Sub Copy_Click()
    On Error GoTo EH
    Application.ScreenUpdating = False
    With Selection
    .Offset(0, 0).Value = Format(TextBox1.Text, "R$ #,##0.00")
    .Offset(1, 0).Value = Format(TextBox2.Text, "R$ #,##0.00")
    .Offset(2, 0).Select
End With
    Application.ScreenUpdating = True
    TextBox3.Text = ""
    Unload Me
Exit Sub
EH:
End Sub
Private Sub UserForm_Initialize()
    TextBox1.Text = ""
    TextBox2.Text = ""
    TextBox3.Text = ""
    Set Rng = ActiveCell
    TextBox3.Text = Rng.Address
End Sub
 
Last edited by a moderator:
Moderator Note:
Is it so hard to add/use code-tags as those has asked to add/use?


How to put this format for accounting
.Offset(0, 0).Value = Format(TextBox1.Text, "R$ #,##0.00")
.Offset(1, 0).Value = Format(TextBox2.Text, "R$ #,##0.00")

I tried this but it didn't work
Format(TextBox1.Text,"$ * #,##0.00") 'Accounting
 
Last edited by a moderator:
Like this?
Fill a value in textbox 1 and textbox 2 and press copy.
And please next time put your code between code tags
Do it like this < your code and at the end />
And next time post a representative example instead of a weak example
 

Attachments

  • Textbox value in selected cells.xlsm
    28.8 KB · Views: 1
Last edited:
What is accounting format?
My last example does exactly what you asked.
Post a similar example with the desired results or figure it out yourself.
 
Back
Top