Guna13
Board Regular
- Joined
- Nov 22, 2019
- Messages
- 70
- Office Version
- 365
- Platform
- Windows
Dear Masters,
This is one of my Pain Area Task now. More than 280+ Excel Files, I was applied this code action one by one by Loop condition. But here Just I copy and paste exact issue code.
Scanriao
In Activeworkbook I have below three sheets.
1.Baan ETB
2.Interim Master Data
3.Interim Acc Validation
I need to copy the data from "Interim Master Data" sheets and paste exact MEP Code Line Item in "Interim Acc Validation" sheets, in Range("B4:E" & Lastrow) .
( Cell value of MEP_Code available in ("Baan ETB") Sheets. (Range.P2.value).... Based on this cell value data only copy and paste it. from Master data to "Interim acc Validation" sheet by Loop condition
Unable to do this VBA code this task. kindly help me sir.. when i run this code. my MEP_Code Value shows "Blank instead of Value. Kindly help and fix this code sir.
This is one of my Pain Area Task now. More than 280+ Excel Files, I was applied this code action one by one by Loop condition. But here Just I copy and paste exact issue code.
Scanriao
In Activeworkbook I have below three sheets.
1.Baan ETB
2.Interim Master Data
3.Interim Acc Validation
I need to copy the data from "Interim Master Data" sheets and paste exact MEP Code Line Item in "Interim Acc Validation" sheets, in Range("B4:E" & Lastrow) .
( Cell value of MEP_Code available in ("Baan ETB") Sheets. (Range.P2.value).... Based on this cell value data only copy and paste it. from Master data to "Interim acc Validation" sheet by Loop condition
Unable to do this VBA code this task. kindly help me sir.. when i run this code. my MEP_Code Value shows "Blank instead of Value. Kindly help and fix this code sir.
VBA Code:
Sub Interim_Acc1()
Dim wss, wss1, wss2, wss3, wss4 As Worksheet
Dim rgdata As Range, rgcriteria As Range, rgoutput As Range
Dim rg As Range
Set wss1 = ThisWorkbook.Sheets("Interim Acc Validation")
Set wss2 = ThisWorkbook.Sheets("Baan ETB")
Set wss4 = ThisWorkbook.Sheets("Info")
Set Trg = ThisWorkbook.Sheets("Interim Master Data")
Set rrr = ThisWorkbook.Sheets("30 FDSS VALIDATION")
wss1.Unprotect password:="1234"
Set rg = ThisWorkbook.Sheets("Interim Acc Validation").Range("A4:H10000")
rg.Clear
wss2.Select
Set rng = wss2.Range("P2:P10000")
With rng
.Value = Evaluate(Replace("If(@="""","""",Trim(@))", "@", .Address))
End With
mep = wss2.Range("P2").Value
Trg.AutoFilterMode = False
If mep <> "" Then
Sheets("Interim Master Data").Range("A1:E10000").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Baan ETB").Range("P1:P2"), _
CopyToRange:=Sheets("Interim Acc Validation").Range("A4"), Unique:=False
wss1.Activate
wss1.Rows(4).EntireRow.Delete
lr = wss1.Range("A" & Rows.Count).End(xlUp).Row
Sheets("Interim Acc Validation").Range("A1").Value = UCase(mep)[/B]
With Sheets("Interim Acc Validation").Cells.Font
.Name = "Calibri"
.Size = 9
End With
End Sub