Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FillDown and FillRight buttons don't work at extreme margins | Excel Discussion (Misc queries) | |||
FillRight | Excel Programming |