Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to another Sheet (Easy)
I have a pop-up text box that fires under certain
conditions in my "Sheet2". The user enters text and it is saved to "Sheet2" when the user hits the command button. This works fine when "Sheet2" is active, however when in another sheet, the data is not written to Sheet2 (likely because it is not the active sheet). How do I specify it should be wriiten to Sheet2 in the example below? Private Sub CommandButton1_Click() Cells(6, 27) = UserForm1.TextBox1 Cells(6, 29) = UserForm1.TextBox2 Cells(6, 28) = Now() Unload UserForm1 End Sub Thanks for any tips!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to another Sheet (Easy)
try:
Sheets("Sheet2").Cells(6,27).Value = UserForm1.TextBox1 cheers, Matt. wrote in message ... I have a pop-up text box that fires under certain conditions in my "Sheet2". The user enters text and it is saved to "Sheet2" when the user hits the command button. This works fine when "Sheet2" is active, however when in another sheet, the data is not written to Sheet2 (likely because it is not the active sheet). How do I specify it should be wriiten to Sheet2 in the example below? Private Sub CommandButton1_Click() Cells(6, 27) = UserForm1.TextBox1 Cells(6, 29) = UserForm1.TextBox2 Cells(6, 28) = Now() Unload UserForm1 End Sub Thanks for any tips!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to another Sheet (Easy)
You could use the line Worksheets("Sheet2").Activate to select sheet
before the userform enters the data. Simo -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refer to another Sheet (Easy)
Thanks guys...problem solved!!!
-----Original Message----- You could use the line Worksheets("Sheet2").Activate to select sheet 2 before the userform enters the data. Simon --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copied formulas refer to destination sheet not source sheet | Excel Worksheet Functions | |||
How can I refer to sheet number not sheet (name)? | Excel Worksheet Functions | |||
Refer to formula in another sheet | Excel Discussion (Misc queries) | |||
Refer new sheet to previous sheet | Excel Worksheet Functions | |||
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X | Excel Programming |