Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2018, 04:51 AM
Homegrownandy Homegrownandy is offline count only rows with a value other than 0 Windows 10 count only rows with a value other than 0 Office 2016
Novice
count only rows with a value other than 0
 
Join Date: Jul 2018
Posts: 15
Homegrownandy is on a distinguished road
Default 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
If anyone has a sugestion i would appreciate it.

its worth mentioning that behind the value its a formula.
Reply With Quote
  #2  
Old 08-02-2018, 09:08 AM
NoSparks NoSparks is offline count only rows with a value other than 0 Windows 7 64bit count only rows with a value other than 0 Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

I could be mistaken, but I think you're asking for assistance with code you're not showing us.
Reply With Quote
  #3  
Old 08-04-2018, 02:38 AM
p45cal's Avatar
p45cal p45cal is offline count only rows with a value other than 0 Windows 10 count only rows with a value other than 0 Office 2016
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

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
Reply With Quote
  #4  
Old 09-24-2018, 10:38 AM
p45cal's Avatar
p45cal p45cal is offline count only rows with a value other than 0 Windows 10 count only rows with a value other than 0 Office 2016
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

…who knows if this helped?
Reply With Quote
  #5  
Old 09-25-2018, 01:21 AM
Homegrownandy Homegrownandy is offline count only rows with a value other than 0 Windows 10 count only rows with a value other than 0 Office 2016
Novice
count only rows with a value other than 0
 
Join Date: Jul 2018
Posts: 15
Homegrownandy is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 09-25-2018, 01:25 AM
Homegrownandy Homegrownandy is offline count only rows with a value other than 0 Windows 10 count only rows with a value other than 0 Office 2016
Novice
count only rows with a value other than 0
 
Join Date: Jul 2018
Posts: 15
Homegrownandy is on a distinguished road
Default

see screenshot.



https://ibb.co/iZ1AhU
Reply With Quote
Reply

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
count only rows with a value other than 0 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 only rows with a value other than 0 Count rows and add blank rows accordingly Hoochtheseal Word VBA 1 01-29-2013 09:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft