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: 4
Default Finding cell closest to textbox

I have a calendar that has the days numbers (ie: 1,2,3,4) in a textbox that
is positioned in the upper left hand corner of the cell for the day of the
week it represents. What I am try to do is highlight the cell that belongs
to the current day. I am using the following code to match the textbox to
the current day, but I can't figure out how to match the textbox to the
relative cell.
code follows...
Sub Test
On Error Resume Next
Dim MyDate As Date
Dim MyDay As Integer
Dim MySh As Integer

MyDate = Date
MyDay = Mid(MyDate, 3, 1)

For i = 1 To ActiveSheet.Shapes.Count
With ActiveSheet
ShNm = .Shapes(i).Name
MySh = Mid(ShNm, 10)
If MyDay = MySh Then
'MsgBox "The number is " & MySh
ActiveSheet.Range("G5").Interior.ColorIndex = 20
End If
End With
Next i
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1
 
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
Array Lookup to Find Closest Date and Next Closest Date [email protected] Excel Worksheet Functions 7 November 7th 07 03:04 AM
finding a date/time in a list that is closest to an existing date/ Jamie Excel Discussion (Misc queries) 1 May 27th 06 08:54 PM
Finding the closest number in column A and take the value in column B reefguy Excel Worksheet Functions 3 May 5th 06 07:25 PM
Finding Closest Match andyiain Excel Worksheet Functions 1 March 15th 06 07:24 PM
Finding closest value within an array Stewart[_3_] Excel Programming 4 September 7th 04 10:09 AM


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