Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I'm hoping some of you Excel Guru's can enlighten me.
Here's what I'm trying to do: I have a sheet open and I paste a column of values in. I don't know how many rows are in the list since it will change every time I want to run this process. I'd like to hit a macro key and get a count of the number of rows in column 1. Is there a way to do this? Thanks for any help! Bruno |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bruno, try this:
ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row Mike F "anonymous" wrote in message ... Hi, I'm hoping some of you Excel Guru's can enlighten me. Here's what I'm trying to do: I have a sheet open and I paste a column of values in. I don't know how many rows are in the list since it will change every time I want to run this process. I'd like to hit a macro key and get a count of the number of rows in column 1. Is there a way to do this? Thanks for any help! Bruno |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In case you need some help setting up the macro:
Press Ctrl and F11 to open the Visual Basic Editor. Select Insert and then Module. Copy the code below and paste it into the module. Close the Editor. Back in the Excel workbook select Tools Macro Macros... (Excel 2003) Click the Options... button and enter "r" in the shortcut box. Press OK and close the dialog box. Control r (Ctrl + r) should then run your macro. --------------------------------- Option Explicit Sub CountRows() Dim Msg As Integer Msg = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row MsgBox "Number of rows = " & Msg & "." End Sub HTH -- Ken Hudson "anonymous" wrote: Hi, I'm hoping some of you Excel Guru's can enlighten me. Here's what I'm trying to do: I have a sheet open and I paste a column of values in. I don't know how many rows are in the list since it will change every time I want to run this process. I'd like to hit a macro key and get a count of the number of rows in column 1. Is there a way to do this? Thanks for any help! Bruno |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Count Rows macro | Excel Discussion (Misc queries) | |||
Count number of rows, where non relevant rows are hidden | Excel Discussion (Misc queries) | |||
Count rows and insert number to count them. | Excel Discussion (Misc queries) |