LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Get rid of need for F2.Select

The code I wrote here works fine except if I don't have the Range("F2").Select in the event sub the double-click leaves F1 in the edit mode.

I can live with that but the range.select haunts me and I'd really prefer that
F1 became the target cell after the code runs, but NOT in the edit mode.

Thanks.
Howard

(Off topic... I notice a bunch of words are underscored in red. Is this part of the new forum upgrade?)

Option Explicit

Sub MsgBoxNotes()
Dim d As String, e As String, f As String
d = Range("A1")
e = Range("A2")
f = Range("A3")
MsgBox d & vbCr & vbCr & e & vbCr & vbCr & f
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim MyIntl As String

If Target = Range("F1") Then
MyIntl = InputBox("Enter your Initials :", "Read Notes.")
If Len(MyIntl) = 0 Then
MsgBox "Enter your initials to read notes", vbCritical
Else
Cells(Rows.count, Range("F1").Offset(1, 0).Column).End(xlUp) _
.Offset(1, 0) = MyIntl
Cells(Rows.count, Range("F1").Offset(1, 1).Column).End(xlUp) _
.Offset(1, 0) = Format(Now(), "dd/MM/yyy hh:mm AMPM")
Range("F2").Select
MsgBoxNotes
End If
End If

End Sub
 
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
Select Previously Selected worksheet (and/or select previouslyselected workbook) Dave K Excel Programming 5 December 11th 10 12:03 AM
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
How to Pre-Select items in Multi-Select List on Form MikeZz Excel Programming 2 August 6th 09 06:33 PM
Macro to select cells without a certain value and select a menu it Guy[_2_] Excel Worksheet Functions 9 January 2nd 09 05:21 PM
error - select method failed - (columns.select) PBcorn Excel Programming 3 May 19th 08 10:49 AM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"