Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default help help help compile error

Try this

With ActiveSheet
.Range("E6:E" & .Cells(.Rows.count, "D").End(xlUp).Row).FormulaR1C1 _
= "=(R2C8/(RC[-3]-RC[-4]))*(3600/1609344)"
End With


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ashw1984" wrote in message
...
the section of this code that say's
(.Rows.count
give's a compile error
but it never used to
i don't think i have changed anything
please can anybody tell me why


Sub CalculateResults()
'this macro calculates the speeds and lengths of the vehicles

If IsEmpty(Range("A6").Value) Then
MsgBox "No Data"
Exit Sub
End If
'this is a fail safe to stop the macro if the sheet is empty

With ActiveSheet.Range("E6:E" & .Cells(.Rows.count,
"D").End(xlUp).Row).FormulaR1C1 _
= "=(R2C8/(RC[-3]-RC[-4]))*(3600/1609344)"
End With
'this code inputs a formula into every cell in column e that has a
coresponding value in row d
With ActiveSheet.Range("f6:f" & .Cells(.Rows.count,
"D").End(xlUp).Row).FormulaR1C1 _
= "=(R2C8/(RC[-2]-RC[-3]))*(3600/1609344)"
End With
'as above but for column f
With ActiveSheet.Range("g6:g" & .Cells(.Rows.count,
"D").End(xlUp).Row).FormulaR1C1 _
= "=average(rc[-1]:rc[-2])"
End With
'as above but for column g
With ActiveSheet.Range("h6:h" & .Cells(.Rows.count,
"D").End(xlUp).Row).FormulaR1C1 _
= "=((rc[-1]/(3600/1609344))*(((rc[-5]-rc[-7])+(rc[-4]-rc[-6]))/2))/1000"
End With
'as above but for column h

End Sub



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
excel compile error. Only some computers? Bob Aylward Excel Discussion (Misc queries) 0 December 13th 05 07:16 PM
compile error in hidden module: autoexecnew - how do I get rid? Joespo Charts and Charting in Excel 1 November 10th 05 03:41 PM
Compile error in hidden module arjay Excel Discussion (Misc queries) 5 September 16th 05 12:47 AM
VBA Error Message "Compile Error...." Steve Excel Discussion (Misc queries) 3 July 15th 05 09:20 AM
Compile error in hidden module: ThisWorkbook Peo Sjoblom Excel Discussion (Misc queries) 0 May 27th 05 09:50 PM


All times are GMT +1. The time now is 10:43 AM.

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"