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: 852
Default Dynamic Offset from an Application.Goto cell = Date or Time

Near the bottom of the code is a Application.Goto monthID statement. The offset lines shown there work but I need to do the following.

I want to offset from the GoTo cell:
1 column to the right and the first empty cell below row 5 = Time

In another macro I need to offset from the GoTo cell:
1 column left and the first empty cell below row 5 = Timee
2 columns left and the first empty cell below row 5 = Date

I am pretty sure if I see how any one of the offsets work, I can adapt the others. I can offset from the GoTo cell but I can't find how to make it dynamic AND add Date/Time

Thanks.
Howard


Sub Scan_Out_Check()

Dim scanIDout As Range
Dim eIDout As String
Dim monthID As Range
Dim LrUIo As Long
Dim LrMonth As Long
Dim sMsg$

eIDout = Sheets("UI").Cells(5, 10)

LrUIo = Sheets("UI").Cells(Rows.Count, "D").End(xlUp).Row

Set scanIDout = Sheets("UI").Range("D18:D" & LrUIo).Find(What:=eIDout, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If Not scanIDout Is Nothing Then

scanIDout.Offset(, -2).Resize(1, 3).Copy Range("I" & Rows.Count).End(xlUp)(2)
scanIDout.Offset(, -2).Resize(1, 3).ClearContents
'Sheets(Format(Date, "mmm yy")).Cells(Rows.Count, "D").End(xlUp)(2) = Time

Set monthID = Sheets(Format(Date, "mmm yy")).Range("C2:BH2").Find(What:=eIDout, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False)

If Not monthID Is Nothing Then

Application.Goto monthID
'Application.Goto monthID.Offset(4, 1)
'Application.Goto monthID.Offset(25, 0)

Else

sMsg = "No match found!"
sMsg = sMsg & vbLf & vbLf
sMsg = sMsg & "Some text here."
MsgBox sMsg, vbExclamation
End If
End If
Sort_In_Scan
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
Copy Application.Union(c.Offset(0, 1), c.Offset(0, 2)... to a list onsame & another sheet Howard Excel Programming 27 September 29th 13 09:20 PM
Dynamic Reference Cell in Offset Formula MarkM Excel Discussion (Misc queries) 3 February 7th 07 05:11 PM
Place a Dynamic Date + a Certain Time in a Cell Sean Excel Worksheet Functions 3 January 6th 07 05:37 PM
Goto a dynamic cell address within a macro blkane Excel Discussion (Misc queries) 3 June 8th 05 07:08 PM
Goto a dynamic cell address within a macro blkane Excel Programming 4 June 8th 05 06:16 PM


All times are GMT +1. The time now is 10:24 PM.

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"