Appologies for wery simple question i have, i'm just new in programming. Is the Activesheet in excel VBA means that if you have a code
Sheets("Point Assignments").Select
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Range("B2:B" & lastrow).Select
Application.CutCopyMode = False
Selection.Copy
The ActiveSheet will be the "Point Assignments"
Also, in the lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row what is meant by .END(xlup). Row
Thanks very much for the help
Regards, Kenneth
.End(xlUp)
is the equivalent of hittingCtrl + Up
in a data range. It will take you to the end of a contiguous range of blank or filled cells. There is alsoxlDown
,xlLeft
andxlRight
. So in the case of your code, it finds the last used row of data by starting at the very last cell and moving up to the first row of data from the bottom. Tim Williams addressed your other question in the answer. – Scott Holtzman