Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
nbs nbs is offline
external usenet poster
 
Posts: 7
Default 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
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
copied formulas refer to destination sheet not source sheet Dantron Excel Worksheet Functions 2 October 21st 09 09:51 PM
How can I refer to sheet number not sheet (name)? DK Excel Worksheet Functions 2 March 30th 09 11:06 PM
Refer to formula in another sheet Jonsson Excel Discussion (Misc queries) 5 December 8th 05 01:09 PM
Refer new sheet to previous sheet Spot Excel Worksheet Functions 2 September 9th 05 02:05 PM
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X tempjones Excel Programming 2 June 7th 04 09:48 PM


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