View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Desert Piranha[_48_] Desert Piranha[_48_] is offline
external usenet poster
 
Posts: 1
Default AutoFill Formula with code


Hi Norm, Dave,
I think i better stick with:

Range("I2").AutoFill Destination:=Range("I2:I" & LRow)
Range("J2").AutoFill Destination:=Range("J2:J" & LRow)
as
Range("I2").AutoFill Destination:=Range("I2:J" & LRow)
gives me:
"AutoFill Method of Range Class Failed"
May have something to do with the fact there are different
formulas in I2 and J2.


I put this 'Application.EnableEvents = True' in a different place and
it
seems to be working so far.
Thx
Dave
Norman Jones Wrote:
Hi Dave,

With the:

Application.EnableEvents = False
Application.EnableEvents = True

stuff, the code dosn't run so i am leaving it out.


Turning events off and, subsequently, back on is advisable and works
for me.
I would suggest that you retry this.

BTW, the code could be slightly simplified by replacing:

Range("I2").AutoFill Destination:=Range("I2:I" & LRow)
Range("J2").AutoFill Destination:=Range("J2:J" & LRow)


with

Range("I2").AutoFill Destination:=Range("I2:J" & LRow)


---
Regards,
Norman


"Desert Piranha"
<Desert.Piranha.22u9dz_1139281202.1139@excelforu m-nospam.com wrote in
message
news:Desert.Piranha.22u9dz_1139281202.1139@excelfo rum-nospam.com...

Hi Gary, Dave, Norman,

I got Garys code to kinda work, needs tweeking.

Normans code is copy and paste, Works Great.

With the:

Application.EnableEvents = False
Application.EnableEvents = True

stuff, the code dosn't run so i am leaving it out.

Thx much for all the input.
Dave



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=509141