mohdamir1989
New Member
- Joined
- Oct 17, 2017
- Messages
- 42
Hi,
I need some help in below code. I recorded the macro and this code generated.
It should save file in same format at the end that part I deleted because it asked for xlsm format so I did to get the code.
What I was doing in this code is basically.
1. Filter "Pending" "Mobile" Status in current sheet.
2. Then Select "P bell" and
3. lookup data against "B" Column from "January Feedback1.xlsx" (Range B:Z) (If possible it should paste values only as I recorded the Macro, I am not sure how to do that part)
4. Save File in current format (xlsx)
Your kind help in this regard is highly appreciated. Thanking you in advance
Best Regards
I need some help in below code. I recorded the macro and this code generated.
It should save file in same format at the end that part I deleted because it asked for xlsm format so I did to get the code.
What I was doing in this code is basically.
1. Filter "Pending" "Mobile" Status in current sheet.
2. Then Select "P bell" and
3. lookup data against "B" Column from "January Feedback1.xlsx" (Range B:Z) (If possible it should paste values only as I recorded the Macro, I am not sure how to do that part)
4. Save File in current format (xlsx)
Code:
Sub Macro1()'
' Macro1 Macro
'
'
Rows("1:1").Select
Range("F1").Activate
Selection.AutoFilter
Range("M1").Select
ActiveSheet.Range("$A$1:$BH$2608").AutoFilter Field:=13, Criteria1:= _
"P bell"
Range("V1").Select
ActiveSheet.Range("$A$1:$BH$2608").AutoFilter Field:=22, Criteria1:= _
"pending"
Range("Q2580").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-15],'[January Feedback1.xlsx]Daily Feedback'!R2C2:R1048576C63,16,0)"
Range("Q2580").Select
Selection.Copy
Range("Q2581").Select
ActiveSheet.Paste
Range("T2580").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-18],'[January Feedback1.xlsx]Daily Feedback'!C2:C63,19,0)"
Range("T2580").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,19,0)"
Range("T2580").Select
Selection.Copy
Range("U2580").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,20,0)"
Range("U2580").Select
Selection.Copy
Range("V2580").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,21,0)"
Range("V2580").Select
Selection.Copy
Range("W2580").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,22,0)"
Range("W2580").Select
Selection.Copy
Range("X2580").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,23,0)"
Range("X2580").Select
Selection.Copy
Range("Y2580").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,24,0)"
Range("Y2580").Select
Selection.Copy
Range("Z2580").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC2,'[January Feedback1.xlsx]Daily Feedback'!C2:C63,25,0)"
Range("T2580:Z2580").Select
Selection.Copy
Range("T2581").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("M1").Select
Selection.AutoFilter
Windows("January Feedback1.xlsx").Activate
Windows("Jan 2018 Feedback file.xlsx").Activate
ChDir _
End Sub
Your kind help in this regard is highly appreciated. Thanking you in advance
Best Regards
Last edited: