Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Selecting Previously Active Cell

Hi

Worksheet module code:

Private Sub Worksheet_Change(ByVal Target As Range)
Set UserForm1.MyCell = Target(1).Offset(0, 1)
Application.EnableEvents = False
UserForm1.Show
End Sub

Userform module code:

Option Explicit
Public MyCell As Range

Private Sub CommandButton1_Click()
Unload Me
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
MyCell.Value = TextBox1.Text
Application.EnableEvents = True
End Sub

HTH. Best wishes Harald

"CDotWin" skrev i melding
...
How do I make the previously active cell, the current active cell after

running a subroutine in VB???

i.e. - I input "Tech" into cell C6 and press Enter (the active cell now

becomes cell C7), and a userform appears. I want the data entered into the
textboxes in the userform to appear in the cell D6.

Please HELP.... Thanks

- CDotWin



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Selecting Previously Active Cell

Glad to hear that. My implementation instructions wasn't among the most
detailed, so you're doing very well. Thanks for the feedback.

Best wishes Harald

"CTInt04" skrev i melding
...
Works like a charm!!!
Thanks!!!



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
Selecting all the active cells in a named column. Colin Hayes Excel Worksheet Functions 14 October 22nd 09 04:47 AM
Selecting cells on active row merry_fay Excel Discussion (Misc queries) 1 May 26th 09 05:30 PM
Selecting/Highlighting active cells wnfisba Excel Discussion (Misc queries) 1 September 27th 06 04:24 PM
Selecting active area of sheet cfspahn24 Excel Discussion (Misc queries) 4 April 17th 06 12:19 PM
Selecting Active Cell before Text Import Routine Paul Excel Programming 2 November 17th 03 10:01 PM


All times are GMT +1. The time now is 11:50 AM.

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"