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: 175
Default Problem coding NextFind

This is an attempt to execute a FindNext.
The user enters a PO# in a UserForm, and after clicking OK, UserForm13
comes up, with all the data pertaining to that PO. That works fine. I
put another button in that form to request to Find the Next Record.
with the same PO, if there is any.

That button's code if below. What I want is for the cell that
contains that next PO to be named "EditPO".

Then, I want to unload the present UserForm13 (which has the data from
the 1ts Find). Then reload UserForm13, which will show the data for the
next record.

Is there something I can do to make the Range Name Add statement below
work within
this procedure? Or, is it plain I'm not going about this correctly?
I tried playing around with different ways to reproduce the "C."
code in the line where I'm trying to name the range.

Thanks for any help you can offer.
J.O.

Private Sub CommandButton3_Click()
'Find Next Record

With Worksheets("Official List").Range("j6:j65536")
Set C = .Find(FindPOVal, LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
'C.Interior.Pattern = xlPatternGray50 (this line is from
the Help Example - left here as reference while figuring out how to
code my next command line, to name range, see next line.)

ActiveWorkbook.Names.Add Name:="EditPO",
RefersTo:=FoundCell
Unload UserForm13
UserForm13.Show

Set C = .FindNext(C)

Loop While Not C Is Nothing And C.Address < firstAddress
End If
End With
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
Help with my coding problem? Dan the Man[_2_] Excel Worksheet Functions 3 September 11th 07 12:02 AM
Problem with coding a msgbox Jacqui Excel Programming 5 November 2nd 05 04:36 PM
problem with coding Subs Excel Programming 5 September 26th 05 03:56 PM
Please help: Coding Problem Tim Excel Programming 4 June 28th 05 05:41 AM
Coding problem John[_105_] Excel Programming 3 June 22nd 05 05:39 PM


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