Hi all, i have some difficulty in understanding the purpose of both types of variables in excel macro. Furthermore, i have a problem in my codes right now,
Dim TotalRow As Integer
Set TotalRow = ActiveSheet.Rows.Count
ActiveCell.Copy
For i = 1 To TotalRow
ActiveCell.Resize(TotalRow).Select
ActiveSheet.Paste
Next i
End Sub
When i compile it i get a "Compile Error: Object Required" msgbox. What does this msgbox means exactly? The words in red font are the ones highlighted by excel.
Thanks!
Dim TotalRow As Integer
Set TotalRow = ActiveSheet.Rows.Count
ActiveCell.Copy
For i = 1 To TotalRow
ActiveCell.Resize(TotalRow).Select
ActiveSheet.Paste
Next i
End Sub
When i compile it i get a "Compile Error: Object Required" msgbox. What does this msgbox means exactly? The words in red font are the ones highlighted by excel.
Thanks!