I am trying to do something pretty simple but don't seem to be able to get it right.
I want to put the maximum value of data from a column in one sheet into a cell on another sheet.
Here is the code I am using:
Could someone put me straight please?
Thanks
I want to put the maximum value of data from a column in one sheet into a cell on another sheet.
Here is the code I am using:
Code:
Sub datamax()
Dim data_range As Range
Sheets("Sheet1").Select
With Sheets("sheet1")
Set data_range = .Range(.Cells(1, "a"), .Cells(54, "a"))
End With
Sheets("Sheet2").Select
Range("A1").Select
ActiveCell.Value = "=max(data_range)"
End Sub
Could someone put me straight please?
Thanks