Hi Team,
i am having data like this in 1 excel file will have 2000 records In BK col we have to filter only "IAUT" data. till this i am having VBA code, its filtering correctly. but when pasting data it is not taking visible cells, only taking 1 cell value to all the rows. please check and give me the data . need urgent
i am having data like this in 1 excel file will have 2000 records In BK col we have to filter only "IAUT" data. till this i am having VBA code, its filtering correctly. but when pasting data it is not taking visible cells, only taking 1 cell value to all the rows. please check and give me the data . need urgent
VBA Code:
Sub RMG()
Dim IBG As String
Dim Comment As Range
Set Macro = Workbooks("RMG_Macro.xlsm")
Set Macrohome = Macro.Sheets("HOME")
Set Macrows = Macro.Sheets("Data")
Set RMG1 = Workbooks.Open(Filename:=(Macrohome.Range("F4").Value))
Set RMG1ws = RMG1.Sheets("RMG Asso Base Data Report_Deliv")
IBG = Macrohome.Range("P4").Value
RMG1ws.Range("$A$1 : $FZ$1000000").AutoFilter Field:=63, Criteria1:=IBG
a = RMG1ws.Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To 100
With RMG1ws
For Each Comment In .Range("BK1", .Cells(.Rows.Count, "BK").End(xlUp)).SpecialCells(xlCellTypeVisible)
If InStr(Comment.Value, "IAUT") > 0 Then
Macrows.Range("A" & i).Value = Comment.Offset(0, -2).Value
Exit For
End If
Next
End With
Next i
End Sub