Hi,
I have two sheets. One having warehouse(18 warehouse) and second having shop (50 Shops).
I need to map shops against warehouse within 200 KM.
I have written one code for the same but need to loop it. Code is mentioned below
Code will copy first warehouse from warehouse sheet and paste it against each all 50 shops in shop sheet.
Then one formula in the sheet (already updated in shop sheet) calculate the difference in KM between each shop and first warehouse. Then filtered out shops within 200 km, copy and paste (transpose) against first warehouse in warehouse sheet. Now I want to do same procedure for second warehouse then third till end. Please help
==================================
Sub RADIUS()
Worksheets("SHOP").Activate
AutoFilterMode = False
Range("f2:g4175").Clear
Worksheets("WAREHOUSE").Activate
Range("C2:d2").Select
Selection.Copy
Worksheets("SHOP").Activate
Range("f2:g4175").PasteSpecial _
Operation:=xlPasteSpecialOperationAdd
Application.Calculation = xlCalculationAutomatic
AutoFilterMode = True
Range("A1:h1").AutoFilter Field:=8, Criteria1:="<=200"
Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Copy _
Worksheets("WAREHOUSE").Activate
Range("e" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub
=================================================
I have two sheets. One having warehouse(18 warehouse) and second having shop (50 Shops).
I need to map shops against warehouse within 200 KM.
I have written one code for the same but need to loop it. Code is mentioned below
Code will copy first warehouse from warehouse sheet and paste it against each all 50 shops in shop sheet.
Then one formula in the sheet (already updated in shop sheet) calculate the difference in KM between each shop and first warehouse. Then filtered out shops within 200 km, copy and paste (transpose) against first warehouse in warehouse sheet. Now I want to do same procedure for second warehouse then third till end. Please help
==================================
Sub RADIUS()
Worksheets("SHOP").Activate
AutoFilterMode = False
Range("f2:g4175").Clear
Worksheets("WAREHOUSE").Activate
Range("C2:d2").Select
Selection.Copy
Worksheets("SHOP").Activate
Range("f2:g4175").PasteSpecial _
Operation:=xlPasteSpecialOperationAdd
Application.Calculation = xlCalculationAutomatic
AutoFilterMode = True
Range("A1:h1").AutoFilter Field:=8, Criteria1:="<=200"
Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Copy _
Worksheets("WAREHOUSE").Activate
Range("e" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub
=================================================