borreltijd
New Member
- Joined
- Jul 2, 2008
- Messages
- 25
Hi everybody,
I need some help with the following.
I have an excel sheet with some buttons and some methods attached to it, everything works fine.
The first worksheet of my excel file is some sort of user interface, it contains among other thins a textbox which I labeled as: 'TextBox'
Next to this textbox is a button which a called ' Save'
I would like that when pressing the button the text in the textbox is saved to a cell in another worksheet of the same excel file.
So in easy lamer code something like this:
Sub SaveText()
TheTextInTheTextBox = TextBox
Worksheets("LogBook").Range("A1").Value = TheTextInTheTextBox
End Sub
' end of code
The save button is used to call the SaveText()
I tried it with the macro recorder with resulted in
I need some help with the following.
I have an excel sheet with some buttons and some methods attached to it, everything works fine.
The first worksheet of my excel file is some sort of user interface, it contains among other thins a textbox which I labeled as: 'TextBox'
Next to this textbox is a button which a called ' Save'
I would like that when pressing the button the text in the textbox is saved to a cell in another worksheet of the same excel file.
So in easy lamer code something like this:
Sub SaveText()
TheTextInTheTextBox = TextBox
Worksheets("LogBook").Range("A1").Value = TheTextInTheTextBox
End Sub
' end of code
The save button is used to call the SaveText()
I tried it with the macro recorder with resulted in
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/29/2008 by gerri00e
'
'
ActiveSheet.Shapes("TextBox").Select
Selection.Characters.Text = "sfsfsdf dfgdfgd dfgdgdf dfgdgd dfgdgdgdg " & Chr(10) & ""
With Selection.Characters(Start:=1, Length:=42).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Sheets("LogBook").Select
ActiveSheet.Paste
End Sub
This doesn't really help me.....
Thanks in advance !