Hi, pedjvak,
if you had indicated what you need that information for IŽd done it in my first post.
Sub EF965621_1()
'Display range in MsgBox
'always works on the active sheet
Dim lngLast As Long
lngLast = Range("A" & Rows.Count).End(xlUp).Row
MsgBox "Range for today covers 'A1:F" & lngLast & "'", vbInformation
End Sub
Sub EF965621_2()
'Copy the range to the clipboard
'always works on the active sheet
Range("A1:F" & Range("A" & Rows.Count).End(xlUp).Row).Copy
End Sub
How to install your new code
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
To run the Excel VBA code:- Press Alt-F8 to open the macro list
- Select a macro in the list
- Click the Run button
Ciao,
Holger
Bookmarks