help with automating a spreadsheet please!!

manaz

New Member
Joined
Mar 18, 2009
Messages
15
Hi

I have created table of jobs my company has to do for a certain customer. Some are complete and some are incomplete.

Currently the incomplete jobs are entered in the 'Incomplete' sheet, once they are completed they are cut and paste to the 'Complete' sheet. Incomplete and complete jobs are defined in the 'Invoiced' Coulmnm as "No' or anything apart from 'no' (as a job is not fully complte until it has been invoiced).

I understand that it may be easier so sort with a new column for just; Complete - Yes or No, which is no problem to change.

The big issue is that I would like to automate excel so that once a job is marked as complete excel automatically removes it form the "incomplete" list and put it in the "complete' list in a seperate sheet.


A small sample workbook has been provided

It may also be important to note that this is only a sample, there are over 4000 jobs in the full workbook.

Thank you very much for any help :)
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hello and welcome to MrExcel.

Try this: right click the Incomplete sheet's tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
If Target.Column = 9 Then
    If LCase(Target.Value) = "yes" Then
        Application.EnableEvents = False
        LR = Sheets("Complete").Range("A" & Rows.Count).End(xlUp).Row
        With Target.EntireRow
            .Copy Destination:=Sheets("Complete").Range("A" & LR + 1)
            .Delete
        End With
        Application.EnableEvents = True
    End If
End If
End Sub

For this to work you will need to enable macros and save the file as an .xlsm file (Excel Macro-Enabled Workbook).
 
Upvote 0
ok so I'm slow, but here is what I came up with

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
AC = Target.Address
Application.EnableEvents = False
 If Range(AC) = "Yes" Then
    LR = Sheets("Incomplete").Cells(Rows.Count, 1).End(xlUp).Row + 1
    Range(AC).EntireRow.Cut Worksheets("Complete").Range("A" & LR)
    Range(AC).EntireRow.Delete
End If
Application.EnableEvents = True

End Sub

this code goes in the Incomplete sheet - so right click on the tab name and click view code. Paste the above code

HTH
 
Upvote 0
thanks guys, i have run into a new problem.

The code above works, but when i use a form to edit the invoices in the 'incomplete' sheet i.e. change the 'invoiced' column from 'no' to 'yes' the record isnt moved to the 'complete' sheet.

Can anyone help with this?
 
Upvote 0
sorry, i have the form button added to the quick access toolbar. I use that to enter the new jobs in the 'incomplete' sheet. Then again to find a specific job and mark it ac complete. How ever when i mark the job off it is not moved to the 'complete' sheet.

does that help?
 
Upvote 0
I don't see why that would affect things ... does the code still run correctly if you mark a job as complete manually?
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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