#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Fillright

I have this small macro that I am using but I can not
figure out how to add to it so it will fill to the right.
I use this macro on various sheets so the amount of
columns and rows change. I would also like to change this
row to Bold font. tia



MyRows = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & "]c:R[-
1]C,0)"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Fillright

The count of used columns uses the column property, so your code would be as
follows.....

MyCols = ActiveSheet.UsedRange.Column.Count

Cheers
N


"Stan" wrote in message
...
I have this small macro that I am using but I can not
figure out how to add to it so it will fill to the right.
I use this macro on various sheets so the amount of
columns and rows change. I would also like to change this
row to Bold font. tia



MyRows = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & "]c:R[-
1]C,0)"





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Fillright

looks like you are putting this formula at the bottom of the column of
numbers - since you want to start with row 1 down to the row above the cell
with the formula
ActiveCell.FormulaR1C1 = "=Countif(R1C:R[-1]C)"

--
Regards,
Tom Ogilvy

"Stan" wrote in message
...
I have this small macro that I am using but I can not
figure out how to add to it so it will fill to the right.
I use this macro on various sheets so the amount of
columns and rows change. I would also like to change this
row to Bold font. tia



MyRows = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & "]c:R[-
1]C,0)"



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Fillright

my macro works but I don't know how to fillright. In
other words, I get the right answer at the end of
column "E", but now how do I modify or add to this macro
so it will fill across all of my columns to the right?

tia


-----Original Message-----
looks like you are putting this formula at the bottom of

the column of
numbers - since you want to start with row 1 down to the

row above the cell
with the formula
ActiveCell.FormulaR1C1 = "=Countif(R1C:R[-1]C)"

--
Regards,
Tom Ogilvy

"Stan" wrote in

message
...
I have this small macro that I am using but I can not
figure out how to add to it so it will fill to the

right.
I use this macro on various sheets so the amount of
columns and rows change. I would also like to change

this
row to Bold font. tia



MyRows = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & "]c:R

[-
1]C,0)"



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Fillright

Sub Macro1()
MyRows = ActiveSheet.UsedRange.Rows.Count
mycols = ActiveSheet.UsedRange.Columns.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & _
"]c:R[-1]C,0)"
Set rng = Range(ActiveCell, Cells(ActiveCell.Row, mycols))
ActiveCell.AutoFill Destination:=rng, Type:=xlFillDefault
End Sub


--
Regards,
Tom Ogilvy

"Stan" wrote in message
...
my macro works but I don't know how to fillright. In
other words, I get the right answer at the end of
column "E", but now how do I modify or add to this macro
so it will fill across all of my columns to the right?

tia


-----Original Message-----
looks like you are putting this formula at the bottom of

the column of
numbers - since you want to start with row 1 down to the

row above the cell
with the formula
ActiveCell.FormulaR1C1 = "=Countif(R1C:R[-1]C)"

--
Regards,
Tom Ogilvy

"Stan" wrote in

message
...
I have this small macro that I am using but I can not
figure out how to add to it so it will fill to the

right.
I use this macro on various sheets so the amount of
columns and rows change. I would also like to change

this
row to Bold font. tia



MyRows = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & "]c:R

[-
1]C,0)"



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Fillright

Awesome Tom, Thanks!!


-----Original Message-----
Sub Macro1()
MyRows = ActiveSheet.UsedRange.Rows.Count
mycols = ActiveSheet.UsedRange.Columns.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & _
"]c:R[-1]C,0)"
Set rng = Range(ActiveCell, Cells(ActiveCell.Row,

mycols))
ActiveCell.AutoFill Destination:=rng,

Type:=xlFillDefault
End Sub


--
Regards,
Tom Ogilvy

"Stan" wrote in

message
...
my macro works but I don't know how to fillright. In
other words, I get the right answer at the end of
column "E", but now how do I modify or add to this macro
so it will fill across all of my columns to the right?

tia


-----Original Message-----
looks like you are putting this formula at the bottom

of
the column of
numbers - since you want to start with row 1 down to

the
row above the cell
with the formula
ActiveCell.FormulaR1C1 = "=Countif(R1C:R[-1]C)"

--
Regards,
Tom Ogilvy

"Stan" wrote in

message
...
I have this small macro that I am using but I can not
figure out how to add to it so it will fill to the

right.
I use this macro on various sheets so the amount of
columns and rows change. I would also like to change

this
row to Bold font. tia



MyRows = ActiveSheet.UsedRange.Rows.Count
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-" & MyRows & "]

c:R
[-
1]C,0)"


.



.

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
FillDown and FillRight buttons don't work at extreme margins Dave O Excel Discussion (Misc queries) 2 April 22nd 08 10:13 PM
FillRight Arthur[_3_] Excel Programming 2 November 4th 03 02:56 PM


All times are GMT +1. The time now is 10:23 PM.

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

About Us

"It's about Microsoft Excel"