New Member
March 7, 2022
hi all ,
i have a macro which will copy paste from one sheet to another based on one criteria i want to add one more criteria for the existing code .can anyone help me out .
the code is as follow:-
Sub AHU_Code(LogConfigurationSheet As Worksheet, iAHU_ID As Integer)
Application.ScreenUpdating = False
On Error Resume Next
Sheet23.Range("B18:E100").ClearContents
Sheet23.Range("B18:E100").ClearFormats
LogConfigurationSheet.Visible = xlSheetVisible
LogConfigurationSheet.Select
Sheet23.Range("Area_Name").Value = Replace(LogConfigurationSheet.Name, " Log Configuration", "")
Dim sFirstOccuranceRow, sLastOccuranceRow As Integer
sFirstOccuranceRow = Split(LogConfigurationSheet.Range("A:A").Find(What:=iAHU_ID, lookat:=xlWhole, searchorder:=xlByRows, SearchDirection:=xlNext).Address, "$")(2)
sLastOccuranceRow = Split(LogConfigurationSheet.Range("A:A").Find(What:=iAHU_ID, lookat:=xlWhole, searchorder:=xlByRows, SearchDirection:=xlPrevious).Address, "$")(2)
g_No_Of_parameters = sLastOccuranceRow - sFirstOccuranceRow + 1
LogConfigurationSheet.Range("B" & sFirstOccuranceRow & ":" & "E" & sLastOccuranceRow).Copy
Sheet23.Range("B18").PasteSpecial
Application.CutCopyMode = False
Call SheetFormatting.Column_Formatting_Default
Call SheetFormatting.Column_Formatting_Adjust
LogConfigurationSheet.Visible = xlSheetHidden
Application.CalculateFull
End Sub
(******************)
sFirstOccuranceRow = Split(LogConfigurationSheet.Range("A:A").Find(What:=iAHU_ID, lookat:=xlWhole, searchorder:=xlByRows, SearchDirection:=xlNext).Address, "$")(2)
sLastOccuranceRow = Split(LogConfigurationSheet.Range("A:A").Find(What:=iAHU_ID, lookat:=xlWhole, searchorder:=xlByRows, SearchDirection:=xlPrevious).Address, "$")(2)
how to added one more criteria fro example i want to search for a string along with IAHU_ID .
please help me out for this
regards
sar
1 Guest(s)