PC Review


Reply
Thread Tools Rate Thread

Big Idea lacking enough knowledge

 
 
robs_drunk@hotmail.com
Guest
Posts: n/a
 
      17th Jul 2007
Hi
I want to be able to count the rows that have data on one sheet
"S1" (A2:BX2) and use that amount to enter a formula on another sheet
"S2" in starting form A6 and then remove the rows that the formula
equals "0". Any ideas

 
Reply With Quote
 
 
 
 
Dan R.
Guest
Posts: n/a
 
      17th Jul 2007
Try something like this:

Sub test()
Set rng1 = Sheets("S1").Range("A2:BX2")
For Each cell In rng1
If cell.Value > 0 Then
count = count + 1
End If
Next cell
Set rng2 = Sheets("S2").Range("A6:A100")
rng2.Formula = "=countif($B:$B, " & count & ")"
End Sub

--
Dan

 
Reply With Quote
 
robs_drunk@hotmail.com
Guest
Posts: n/a
 
      25th Jul 2007
On Jul 18, 12:59 am, "Dan R." <Dan.R.Oa...@gmail.com> wrote:
> Try something like this:
>
> Sub test()
> Set rng1 = Sheets("S1").Range("A2:BX2")
> For Each cell In rng1
> If cell.Value > 0 Then
> count = count + 1
> End If
> Next cell
> Set rng2 = Sheets("S2").Range("A6:A100")
> rng2.Formula = "=countif($B:$B, " & count & ")"
> End Sub
>
> --
> Dan


Thanks Dan Works a Treat!!!
How can i get the lines that return "0" now from the formula to
disappear ?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is LinkedList lacking so much? Steve Microsoft C# .NET 2 2nd Jun 2006 08:43 PM
Nice idea lack of knowledge! =?Utf-8?B?Y2FybmVsYWlu?= Microsoft Excel Misc 3 21st Mar 2006 07:40 PM
Lacking GUI design Ryan Rugg Spyware Discussion 4 8th Jul 2005 04:33 AM
Microsoft Knowledge Base Article - 832285Microsoft Knowledge BaseArticle - 832285 Alain Microsoft Excel Setup 3 18th Jan 2004 05:54 PM
lacking dll for kernel?? smcinto22 Windows XP New Users 1 15th Oct 2003 04:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:55 AM.