Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default AutoFill to start with Selected Cell

My VBA looks for a cell first, then Selects another Cell in the same Row, and
then puts a Formula in the Active Cell,
and then I have a Problem trying to Auto-Fill this formula;
When dragging the Formula down I need to define a Range starting with the
Active Cell, and I can't seem to get this to work.
What do I put instead of "ActiveCell" in my Macro here below:

Columns("C:C").Select
Selection.Find(What:="NO", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Select
Cells(Selection.Row, "G").Select
ActiveCell.FormulaR1C1 = _

"=IF(COUNTIF(RC[-2],""*"")0,IF(RC[-2]=RC[-6],""OK"",""WRONG!!!""),""@"")"
Selection.AutoFill Destination:=Range("ActiveCell:G7200"),
Type:=xlFillDefault

I would really appreciate any help on this, for which Many Thanks in advance!!
Hilvert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default AutoFill to start with Selected Cell

Destination:=Range(ActiveCell.Address & ":G7200")

Assuming the Active cell is in column G.

The following code will filldown the formula in E1 as far down column E as
there is data in column D.
Range("E1", Range("D1").End(xlDown)).Offset(0, 1).FillDown

Mike F
"Hilvert Scheper" wrote in
message ...
My VBA looks for a cell first, then Selects another Cell in the same Row,
and
then puts a Formula in the Active Cell,
and then I have a Problem trying to Auto-Fill this formula;
When dragging the Formula down I need to define a Range starting with the
Active Cell, and I can't seem to get this to work.
What do I put instead of "ActiveCell" in my Macro here below:

Columns("C:C").Select
Selection.Find(What:="NO", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Select
Cells(Selection.Row, "G").Select
ActiveCell.FormulaR1C1 = _

"=IF(COUNTIF(RC[-2],""*"")0,IF(RC[-2]=RC[-6],""OK"",""WRONG!!!""),""@"")"
Selection.AutoFill Destination:=Range("ActiveCell:G7200"),
Type:=xlFillDefault

I would really appreciate any help on this, for which Many Thanks in
advance!!
Hilvert



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default AutoFill to start with Selected Cell

Brilliant, Just what I needed. Thank You very much indeed Mike!!

"Mike Fogleman" wrote:

Destination:=Range(ActiveCell.Address & ":G7200")

Assuming the Active cell is in column G.

The following code will filldown the formula in E1 as far down column E as
there is data in column D.
Range("E1", Range("D1").End(xlDown)).Offset(0, 1).FillDown

Mike F
"Hilvert Scheper" wrote in
message ...
My VBA looks for a cell first, then Selects another Cell in the same Row,
and
then puts a Formula in the Active Cell,
and then I have a Problem trying to Auto-Fill this formula;
When dragging the Formula down I need to define a Range starting with the
Active Cell, and I can't seem to get this to work.
What do I put instead of "ActiveCell" in my Macro here below:

Columns("C:C").Select
Selection.Find(What:="NO", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Select
Cells(Selection.Row, "G").Select
ActiveCell.FormulaR1C1 = _

"=IF(COUNTIF(RC[-2],""*"")0,IF(RC[-2]=RC[-6],""OK"",""WRONG!!!""),""@"")"
Selection.AutoFill Destination:=Range("ActiveCell:G7200"),
Type:=xlFillDefault

I would really appreciate any help on this, for which Many Thanks in
advance!!
Hilvert




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default AutoFill to start with Selected Cell

That code was actually given to me by Tom Olgivy a few years ago, and I
thought it was brilliant then.

Mike F
"Hilvert Scheper" wrote in
message ...
Brilliant, Just what I needed. Thank You very much indeed Mike!!

"Mike Fogleman" wrote:

Destination:=Range(ActiveCell.Address & ":G7200")

Assuming the Active cell is in column G.

The following code will filldown the formula in E1 as far down column E
as
there is data in column D.
Range("E1", Range("D1").End(xlDown)).Offset(0, 1).FillDown

Mike F
"Hilvert Scheper" wrote in
message ...
My VBA looks for a cell first, then Selects another Cell in the same
Row,
and
then puts a Formula in the Active Cell,
and then I have a Problem trying to Auto-Fill this formula;
When dragging the Formula down I need to define a Range starting with
the
Active Cell, and I can't seem to get this to work.
What do I put instead of "ActiveCell" in my Macro here below:

Columns("C:C").Select
Selection.Find(What:="NO", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Select
Cells(Selection.Row, "G").Select
ActiveCell.FormulaR1C1 = _

"=IF(COUNTIF(RC[-2],""*"")0,IF(RC[-2]=RC[-6],""OK"",""WRONG!!!""),""@"")"
Selection.AutoFill Destination:=Range("ActiveCell:G7200"),
Type:=xlFillDefault

I would really appreciate any help on this, for which Many Thanks in
advance!!
Hilvert






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
Autofill cell/sets of cells based upon value selected from a list. Brazil Excel Discussion (Misc queries) 1 February 5th 07 08:45 AM
formula or VBA - would like to autofill cells based on start date and # of months jsr Excel Programming 2 June 14th 06 03:55 PM
Macro to start when cell selected JackR Excel Discussion (Misc queries) 5 March 20th 06 04:01 PM
Determine currently selected cells at start of macro Piers 2k Excel Programming 2 March 2nd 05 01:52 PM
Determining Start & End Points in Selected Cells Chris Hankin Excel Programming 4 June 28th 04 12:27 PM


All times are GMT +1. The time now is 12:11 AM.

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"