Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default application.match question


--
--Chip Smith--
MVP Wannabe :)almost there but not quite. i'm using application.match in a
macro to find a
value inserted by the user in a userform. so the macro searches the
spreadsheet for the value and finds it. but what i want to do is when it
finds that value, it makes it the activecell...the macro kinda looks like
this -

Private Sub cmdAlt_Click()

Dim HFC As String
Dim Index As Variant
Dim nextrow As Long

HFC = Me.txtHFC1.Value

nextrow = Range("A65536").Row + 1

Index = Application.Match(HFC, Range("Sheet1!A1:A65536"), 0)

If IsError(Index) Then
MsgBox "Not Found, check HFC MAC and try again"
End If

Range(Index).Select

ActiveCell.Offset(0, 2).Value = Me.txtUser.Value
ActiveCell.Offset(0, 3).Value = Me.txtStat2.Value

Me.txtHFC1.Value = ""
Me.txtUser.Value = ""
Me.txtStat2.Value = ""
Me.txtHFC1.SetFocus

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default application.match question

You have another response to your other post.

Chip Smith wrote:

--
--Chip Smith--
MVP Wannabe :)almost there but not quite. i'm using application.match in a
macro to find a
value inserted by the user in a userform. so the macro searches the
spreadsheet for the value and finds it. but what i want to do is when it
finds that value, it makes it the activecell...the macro kinda looks like
this -

Private Sub cmdAlt_Click()

Dim HFC As String
Dim Index As Variant
Dim nextrow As Long

HFC = Me.txtHFC1.Value

nextrow = Range("A65536").Row + 1

Index = Application.Match(HFC, Range("Sheet1!A1:A65536"), 0)

If IsError(Index) Then
MsgBox "Not Found, check HFC MAC and try again"
End If

Range(Index).Select

ActiveCell.Offset(0, 2).Value = Me.txtUser.Value
ActiveCell.Offset(0, 3).Value = Me.txtStat2.Value

Me.txtHFC1.Value = ""
Me.txtUser.Value = ""
Me.txtStat2.Value = ""
Me.txtHFC1.SetFocus

End Sub


--

Dave Peterson
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
application.match Chip Smith Excel Discussion (Misc queries) 3 March 30th 06 08:56 PM
Application.Match SIGE Excel Programming 4 March 30th 05 03:06 PM
Application.Match [email protected] Excel Programming 5 September 2nd 04 04:22 PM
Application.Match [email protected] Excel Programming 0 September 2nd 04 04:07 PM
Application.Match [email protected] Excel Programming 1 September 2nd 04 08:20 AM


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