Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / April 2008

Tip: Looking for answers? Try searching our database.

AutoFill to start with Selected Cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hilvert Scheper - 30 Apr 2008 10:18 GMT
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
Mike Fogleman - 30 Apr 2008 12:01 GMT
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
> My VBA looks for a cell first, then Selects another Cell in the same Row,
> and
[quoted text clipped - 20 lines]
> advance!!
> Hilvert
Hilvert Scheper - 30 Apr 2008 14:59 GMT
Brilliant, Just what I needed. Thank You very much indeed Mike!!

> Destination:=Range(ActiveCell.Address & ":G7200")
>
[quoted text clipped - 29 lines]
> > advance!!
> > Hilvert
Mike Fogleman - 01 May 2008 00:27 GMT
That code was actually given to me by Tom Olgivy a few years ago, and I
thought it was brilliant then.

Mike F
> Brilliant, Just what I needed. Thank You very much indeed Mike!!
>
[quoted text clipped - 34 lines]
>> > advance!!
>> > Hilvert
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.