Hi,
Ive been struggling getting a fault reporting system to work. My macro knowledge only goes as far as recording and editing code to suit.
I have a set of spreadheets on different computers that I have a macro that copies lines of data into another excel file and distributes as required, and also into an overall 'master' sheet.
However, I now need to be able to enter in the 'status' column when a job is completed, and copy back to the other files.
Below is a more simple version of the spreadsheet. I want to find the status column and then look down this to find the 'closed' jobs, then look for the 'fault' number. This 'fault' number matches another spreasheet, so the row needs to be copied and paste over the corresponding row. I need to loop this down the wole status column until I reach the bottom and repeat for the 'in prog' jobs too
fault test type status date comment
1 1 water open
2 3 water open
3 2 electrical closed
4 1 hardware open
5 1 software in prog
6 1 hardware open
This is what i started with but im aware its mostly rubbish
Sub Macro1()
'
' Macro1 Macro
'
Dim FaultID As Integer
Dim i As Integer
'Dim lastrow As Long
Dim StatusColumn As Integer
i = 1
' Turn off screenupdates and determine course of action on error:
Application.ScreenUpdating = False
Sheets("Overall").Activate
'Find "status" column number and Determine if change has been made to faults
Range("A1:f20").Select
Selection.Find(What:="Status", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
StatusColumn = ActiveCell.Column
i = i + 1
Do While RowCount
For i = 1 To 5000
'when rowcount not = spaces and <5000
Range("statuscolumn").Select
Selection.Find(What:="closed", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
.....etc
End sub
I hope this is clear, really appreciate any help as you can see im not getting very far
Bookmarks