Hi all,
I wrote a code in office 365 and it work fine when I tried to run it on office 2010 the excel is not responding
code attached
I wrote a code in office 365 and it work fine when I tried to run it on office 2010 the excel is not responding
code attached
Rich (BB code):
Sub RectangleRoundedCorners1_Click()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for Main_0.log", FileFilter:="Excel Files (*.log*),*log*")
If FileToOpen = "False" Then
Exit Sub
End If
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A1:B99999").Copy
ThisWorkbook.Worksheets("Main_0").Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
OpenBook.Close False
'Y counts from Stage'
Range("N2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(LEFT(MID(RC[-13],FIND("" Y :"", RC[-13])+4,LEN(RC[-13])),FIND(""("",MID(RC[-13],FIND("" Y :"",RC[-13])+4,LEN(RC[-13])))-1),"""")"
Range("N2").Select
Selection.AutoFill Destination:=Range("N2:N150000"), Type:=xlFillDefault
Range("N2:N150000").Select
Range("O2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(LEFT(MID(RC[-14],FIND(""Y laser :"",RC[-14])+9,LEN(RC[-14])),FIND("","",MID(RC[-14],FIND(""Y laser :"",RC[-14])+9,LEN(RC[-14])))-1),"""")"
Range("O2").Select
Selection.AutoFill Destination:=Range("O2:O150000")
Range("O2:O150000").Select
Range("P2").Select
ActiveCell.FormulaR1C1 = "=ROW(RC[-15])"
Range("P2").Select
Selection.AutoFill Destination:=Range("P2:P150000")
Range("P2:P150000").Select
Columns("N:N").Select
Selection.AutoFilter
ActiveSheet.Range("$N$1:$N$100162").AutoFilter Field:=1, Criteria1:="<>", Operator:=xlAnd, Criteria2:="<>#VALUE!"
With Range("P2:P150000")
row20 = Evaluate("AGGREGATE(14,7," & .Address & ",20)")
row1 = Evaluate("AGGREGATE(14,7," & .Address & ",1)")
ActiveSheet.Range(Range("N" & row20), Range("O" & row1)).SpecialCells(xlCellTypeVisible).Copy Destination:=ThisWorkbook.Worksheets("Y Laser Factor").Range("B4")
End With
Worksheets("Y Laser Factor").Range("O2").Formula = "=IFERROR(Average(D4:D23),"""")"
Application.ScreenUpdating = True
Worksheets(ActiveSheet.Index - 1).Select
Range("O2").Select
Selection.Copy
Range("D24").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub