Good morning all!
I am in need of some assistance I have this macro below that copies cells from "Import_file" to "Master Inst List". The infomation in the "Import_file" sheet is brought in from a .txt file that is generated by AutoCAD and then brought into excel. The macro looks for the record no. (column B) in the "Import_file" and then looks for that same record no. in the "Master Inst List". When the macro finds a match it copies the entire row related to that record no. and pastes it into the matching record no. it found.
Sub Match_Copy_into_list()
Dim i As Integer
Dim m As Variant
Sheets("Import_export").Select
ActiveWorkbook.RefreshAll
Range("B2").Select
ActiveWorkbook.Worksheets("Import_file").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Import_file").Sort.SortFields.Add Key:=Range("B2"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Import_file").Sort
.SetRange Range("A2:AZ10000")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
For i = 1 To 10000
On Error Resume Next
m = Application.WorksheetFunction.Match(Cells(i, 2), Sheets("Master Inst List").Range("B:B"), False)
If Err.Number = 1004 Then GoTo Cycle
Cells(i, 1).Resize(1, 50).Copy Sheets("Master Inst List").Cells(m, 1)
Cycle:
Next
End Sub
Here is my question.......... I would like the macro to copy and paste all of the columns in the row related to the matching record no. except for column H. Is there a way to have to tell the macro to copy all rows but to skip over column H? Am I making any sense???
I hope you can help! I have pasted my worksheet below
Bookmarks