#1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default vba code

why does this code not input a formula into cells
e5 to end of data

Range("D6").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Do Until Range("E5").Select
ActiveCell.FormulaR1C1 = "=R2C8/(RC[-2]-RC[-4])"
ActiveCell.Offset(-1, 0).Range("a1").Select
Loop

  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default vba code

Hi agw,

Try the following change:


Do Until ActiveCell.Address = "$E$5"

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default vba code

It looks like you're using column D to get the last used cell.

If that's true:

with activesheet
.range("E5:E" & .cells(.rows.count,"D").end(xlup).row).formular1c1 _
= "=R2C8/(RC[-2]-RC[-4])"
end with

wrote:

why does this code not input a formula into cells
e5 to end of data

Range("D6").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Do Until Range("E5").Select
ActiveCell.FormulaR1C1 = "=R2C8/(RC[-2]-RC[-4])"
ActiveCell.Offset(-1, 0).Range("a1").Select
Loop


--

Dave Peterson
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
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 4th 05 10:50 AM


All times are GMT +1. The time now is 09:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"