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: 10
Default Using a macro to locate a user given value

Essentially I am having a problem with a macro, in that I created a Userform.
Data put into the first txt box will in turn be used to look up that
particular value in my spreadsheet, column K to be exact, once it finds the
value that was inserted in the first txt box in the user form, it then
recalulates a previous entry. heres the macro thus far....

Private Sub cmdAdd_Click()
Dim Order As Boolean
Dim Index As Variant
Dim nextrow As Long
Dim myRng As Range

Order = Me.txtOrder.Value

Set myRng = Range("a:k")

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

Index = Application.Match(Order, myRng, 0)

If IsError(Index) Then
MsgBox "Not Found, check Order No. and try again"
Else
myRng(Index).Select
ActiveCell.Offset(0, -9).Value = Cells.Value + (Me.txtShip.Value /
Me.txtPart.Value)
End If

Me.txtOrder.Value = ""
Me.txtShip.Value = ""
Me.txtPart.Value = ""
Me.txtOrder.SetFocus

End Sub

--
--Chip Smith--

 
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
Locate data macro Malcolm McM[_2_] Excel Discussion (Misc queries) 2 April 26th 10 11:43 PM
Macro to locate/modify text Nate[_6_] Excel Programming 1 August 17th 06 06:54 PM
Locate and Format Row Macro ksp Excel Programming 2 June 12th 06 06:50 AM
locate picture location using macro ME @ Home Excel Programming 5 February 19th 06 07:23 PM
Crrection Help for a macro to locate max value cell twinklejmj[_9_] Excel Programming 2 September 24th 05 04:46 PM


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