don't get to do a second edit

ndendrinos

Well-known Member
Joined
Jan 17, 2003
Messages
1,694
Code:
Sub Match_Row54()
    Dim cell As Range, Found As Range, Firstfound As String
    Sheets("Invoice").Select
    For Each cell In Range("D17:D35")
        If Not IsEmpty(cell) Then
        Set Found = Rows(54).Find(cell.Value, Cells(54, Columns.Count), xlValues, xlWhole, xlByColumns, xlNext, False)
            
            If Not Found Is Nothing Then
                Firstfound = Found.Address
                Do
                    If Found.Offset(3) < 0 Then
                        Found.Offset(1).Select
                        UserForm1.Show
              End If
                    Set Found = Rows(54).FindNext(After:=Found)
                    If Found Is Nothing Then Exit Do
                Loop Until Found.Address = Firstfound Or Found Is Nothing
            End If
        End If
            
    Next cell
    

End Sub

I use above to edit [B17:B35] thanks to a userform's textbox.
When I get the userform up I edit the first row and the userform disappears instead of staying on in case there is more than one row that needs editing. Is there something missing in the code? I really can't tell

Thank you
 
Norie
Being doing this for the past 8 years now (talk about persistence)
It is a data base focusing on preparing invoices.
Over the years I've done this using Excel as front end and Access as the database with all the bells and whistles you can imagine.

Done another one with 2 excel workbooks.

Another one with a simple invoice sheet that would migrate the data to customers folders

I forget what the fourth was...

All had one thing in common ... each cell of the invoice would be kept on one row and I could search any Invoice by migrating that row back onto a template.

Also some other goodies that would help a user on the phone talking to a customer by retrieving information on past invoices, statements etc...
Also and that's what I'm presently working on an elementary Inventory control.

Nothing earth shaking but I learned a little bit along the way and had a lot of fun.

I figure by the time I finish this one Excel will be obsolete but hey so will I.
I get great pleasure in seeing the results of Excel's automation.
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Nick

I'm sorry but I really don't know what to say.:eek:
 
Upvote 0
Switched things around a bit and now I get to do all my edits but I have a new problem with an never ending loop if there are more than one edits to do.

Not sure how to edit the font and make it stand out so I'll repeat that the problem occurs if there are more than one edits to do.


The culprit I suspect is here:
Code:
Dim cell As Range, Found As Range, Firstfound As String
    Sheets("Invoice").Select
    For Each cell In Range("D17:D35")
        If Not IsEmpty(cell) Then
        Set Found = Rows(54).Find(cell.Value, Cells(54, Columns.Count), xlValues, xlWhole, xlByColumns, xlNext, False)
            
            If Not Found Is Nothing Then
                Firstfound = Found.Address
                Do
                    If Found.Offset(3) < 0 Then
                        Found.Offset(1).Select
                        UserForm1.Show
              End If
                    Set Found = Rows(54).FindNext(After:=Found)
                    If Found Is Nothing Then Exit Do
                Loop Until Found.Address = Firstfound Or Found Is Nothing
            End If
        End If
            
    Next cell

The latest version of the WB can be found here:
http://www.box.net/shared/scp9fhfbh7
 
Upvote 0
It now works and for anyone interested a copy of the last revision is here:
http://www.box.net/shared/99qfl4t8sv

There is one thing that still bothers me and that is like this:
When editing the qty to ship I get to see the result of my edits only after the code runs in its entirety and not as I edit the cells one by one.

Maybe someone will take the time to check the file

Many thanks
 
Upvote 0
now it's OK
http://www.box.net/shared/yzqfv3vub3

There is one thing that still bothers me and that is like this:
When editing the qty to ship I get to see the result of my edits only after the code runs in its entirety and not as I edit the cells one by one.
Would prefer to see the edits done one by one.

Thank you
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,821
Members
449,340
Latest member
hpm23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top