PC Review


Reply
Thread Tools Rate Thread

AutoFill to start with Selected Cell

 
 
Hilvert Scheper
Guest
Posts: n/a
 
      30th Apr 2008
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 With Quote
 
 
 
 
Hilvert Scheper
Guest
Posts: n/a
 
      30th Apr 2008
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" <(E-Mail Removed)> wrote in
> message news:8B5C7007-34D0-4D8C-9D9B-(E-Mail Removed)...
> > 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 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
Autofill cell/sets of cells based upon value selected from a list. =?Utf-8?B?QnJhemls?= Microsoft Excel Misc 1 5th Feb 2007 08:45 AM
Macro to start when cell selected =?Utf-8?B?SmFja1I=?= Microsoft Excel Misc 8 20th Mar 2006 04:01 PM
how read value from last selected cell? It is possible? how get adress last selected cell? Andrzej Microsoft Excel New Users 4 30th May 2005 07:28 PM
how read value from last selected cell? It is possible? how get adress last selected cell? Andrzej Microsoft Excel Programming 1 30th May 2005 06:18 PM
Changing cell colour when cell selected/de-selected by mouse/arrow keys Joe Hannett Microsoft Excel Misc 5 12th Aug 2004 05:39 PM


Features
 

Advertising
 

Newsgroups
 


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