Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default printing formula to a particular Count

How do i set this formula so that rng2 only prints as many fields as
the count of rng1?

Set rng1 = Sheets("Imported Budget Data").Range("A2:BX2")
For Each cell In rng1
If cell.Value 0 Then
Count = Count + 1
End If
Next cell
Set rng2 = Sheets("SandBox").Range("B6:B100")
rng2.Formula = "=IF(Home!$B$5='Imported Budget Data'!BX2,'Imported
Budget Data'!S2,)"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default printing formula to a particular Count

What exactly do you mean by print, formulae don't print.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
How do i set this formula so that rng2 only prints as many fields as
the count of rng1?

Set rng1 = Sheets("Imported Budget Data").Range("A2:BX2")
For Each cell In rng1
If cell.Value 0 Then
Count = Count + 1
End If
Next cell
Set rng2 = Sheets("SandBox").Range("B6:B100")
rng2.Formula = "=IF(Home!$B$5='Imported Budget Data'!BX2,'Imported
Budget Data'!S2,)"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default printing formula to a particular Count

By print I mean that the formula is written into cells B6:B100 but i
want the formula to be written in to only as many cells as that where
counted in rng1.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default printing formula to a particular Count

OK, does this do it

Set rng1 = Sheets("Imported Budget Data").Range("A2:BX2")
For Each cell In rng1
If cell.Value 0 Then
Count = Count + 1
End If
Next cell
Set rng2 = Sheets("SandBox").Range("B6:B" & Count + 6)
rng2.Formula = "=IF(Home!$B$5='Imported Budget Data'!BX2,'Imported
Budget Data'!S2,)"


BTW, best to avoid variable names like Count, it is a property of
collections so may confuse or even fail in worst cases.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
oups.com...
By print I mean that the formula is written into cells B6:B100 but i
want the formula to be written in to only as many cells as that where
counted in rng1.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Formula - Count Ticks LittleAnn Excel Discussion (Misc queries) 3 May 8th 23 07:44 PM
Printing: page count exceeds pages in tab Dave O Excel Discussion (Misc queries) 1 February 2nd 12 08:35 PM
Trying to construct a count count formula Chris K Excel Discussion (Misc queries) 6 May 26th 07 07:20 PM
Need Help on Formula For Printing brickman Excel Programming 2 September 2nd 05 09:09 AM
Printing a formula TNMAN Excel Worksheet Functions 2 January 6th 05 09:06 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"