Hi guys,
I am looking to do the following:
Have a button that when selected in another page, will find data across two different coloums in a different page, then copy and paste that data into another after wiping the page that the data is being copied into (as it will be used again for another search).
At the moment I have coding that will do that for one coloum only and works, however I now need it to search across two!
This is the coding I am currently using:
Sub BNEGPU()
' BNEute Macro
Dim LPaste As Integer
Application.ScreenUpdating = False
LPaste = 8
Sheets("Report").Select
Range("O2:P7").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Report").Select
Range("A8:M1000").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("MasterList").Select
Sheets("MasterList").Select
RowCount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To RowCount
Range("C" & i).Select
check_value = ActiveCell
If check_value = "GPU" Or check_value = "gpu" Or check_value = "Gpu" Or check_value = "g p u" Or check_value = "Ground Power Unit" Or check_value = "ground power unit" Or check_value = "Ground power unit" Or check_value = "GPUS" Or check_value = "GPUs" Or check_value = "GROUND POWER UNIT" Then
ActiveCell.EntireRow.Copy
Sheets("Report").Select
RowCount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
Range("a" & RowCount + 1).Select
Rows(CStr(LPaste) & ":" & CStr(LPaste)).Select
Selection.PasteSpecial Paste:=xlPasteValues
LPaste = LPaste + 1
Sheets("MasterList").Select
End If
Next
Sheets("Report").Select
Range("N8").Select
ActiveCell.FormulaR1C1 = _
"=IF(ISBLANK(RC[-1]),"""",RANK(RC[-1],R8C13:R151C13,1))"
Range("N8").Select
Selection.AutoFill Destination:=Range("N8:N1000"), Type:=xlFillDefault
Sheets("Risk Assessments").Select
Range("M14").Select
Selection.Copy
Sheets("Report").Select
Range("O2").Select
ActiveSheet.Paste
Sheets("Risk Assessments").Select
Range("M7").Select
Selection.Copy
Sheets("Report").Select
Range("P2").Select
ActiveSheet.Paste
Range("I1").Select
Application.ScreenUpdating = True
End Sub
Can anyone help!!
Thanks!
I am looking to do the following:
Have a button that when selected in another page, will find data across two different coloums in a different page, then copy and paste that data into another after wiping the page that the data is being copied into (as it will be used again for another search).
At the moment I have coding that will do that for one coloum only and works, however I now need it to search across two!
This is the coding I am currently using:
Sub BNEGPU()
' BNEute Macro
Dim LPaste As Integer
Application.ScreenUpdating = False
LPaste = 8
Sheets("Report").Select
Range("O2:P7").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Report").Select
Range("A8:M1000").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("MasterList").Select
Sheets("MasterList").Select
RowCount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To RowCount
Range("C" & i).Select
check_value = ActiveCell
If check_value = "GPU" Or check_value = "gpu" Or check_value = "Gpu" Or check_value = "g p u" Or check_value = "Ground Power Unit" Or check_value = "ground power unit" Or check_value = "Ground power unit" Or check_value = "GPUS" Or check_value = "GPUs" Or check_value = "GROUND POWER UNIT" Then
ActiveCell.EntireRow.Copy
Sheets("Report").Select
RowCount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
Range("a" & RowCount + 1).Select
Rows(CStr(LPaste) & ":" & CStr(LPaste)).Select
Selection.PasteSpecial Paste:=xlPasteValues
LPaste = LPaste + 1
Sheets("MasterList").Select
End If
Next
Sheets("Report").Select
Range("N8").Select
ActiveCell.FormulaR1C1 = _
"=IF(ISBLANK(RC[-1]),"""",RANK(RC[-1],R8C13:R151C13,1))"
Range("N8").Select
Selection.AutoFill Destination:=Range("N8:N1000"), Type:=xlFillDefault
Sheets("Risk Assessments").Select
Range("M14").Select
Selection.Copy
Sheets("Report").Select
Range("O2").Select
ActiveSheet.Paste
Sheets("Risk Assessments").Select
Range("M7").Select
Selection.Copy
Sheets("Report").Select
Range("P2").Select
ActiveSheet.Paste
Range("I1").Select
Application.ScreenUpdating = True
End Sub
Can anyone help!!
Thanks!