#1
|
|||
|
|||
count only rows with a value other than 0
Im using code to copy rows from excel and paste them into a word table. The problem is its including zero (0) value cells as they are from a formula.
In the advanced options for the worksheet I have turned off the option to display the 0 but still it will copy these cells. To count i am using this code Code:
lngLastRow = Sheets("RISKS").Range("A65535").End(xlUp).Row its worth mentioning that behind the value its a formula. |
#2
|
|||
|
|||
I could be mistaken, but I think you're asking for assistance with code you're not showing us.
|
#3
|
||||
|
||||
a guess:
Code:
lngLastRow = Sheets("RISKS").Range("A65535").End(xlUp).Row Do Until Sheets("RISKS").Range("A" & lngLastRow).Value <> 0 lngLastRow = lngLastRow - 1 Loop 'now lngLastRow contains last non-zero value in column A |
#4
|
||||
|
||||
…who knows if this helped?
|
#5
|
|||
|
|||
Thanks for the reply. I didnt get email updates that you replied for the ones last month. I have not tested your solution as I found an alternative way,
Sorry for not responding earlier. |
#6
|
|||
|
|||
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to find duplicate rows in a huge excel file containing 500000 rows | Stc25234 | Excel Programming | 2 | 06-23-2017 10:51 AM |
Nested tables. Count rows | NevilleT | Word VBA | 9 | 05-10-2017 05:22 AM |
Getting the Count formula to count all rows | Jennifer Murphy | Word Tables | 11 | 08-23-2016 09:37 PM |
simple way to count rows in a table? | bkcell | Word | 4 | 03-09-2015 09:06 PM |
Count rows and add blank rows accordingly | Hoochtheseal | Word VBA | 1 | 01-29-2013 09:23 PM |