Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Hopefully a real easy vba question

The line with activecell.formula is not correct. What I'm trying to do is to
add up the time for person 1-16 on the total page if the date isn't a holiday.

Sub TotalThemUp()
Dim i As Long
Dim j As Long
Range("startpoint").Select
Range("B11:AF22").ClearContents
For i = 1 To 12
For j = 1 To 31
If ActiveCell.Offset(i, j) < "H" Then
ActiveCell.Formula&"R"&i&"C"&j =
"=sum(Person1:Person16!)"&"R"&i&"C"&j
End If
Next j
Next i
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Hopefully a real easy vba question

I believe you are wanting multiple formulas as an output in the range of
B11:AF22?
Corrected syntax:

Sub TotalThemUp()
Dim i As Long
Dim j As Long
Range("startpoint").Select
Range("B11:AF22").ClearContents
For i = 0 To 11
For j = 0 To 30
If ActiveCell.Offset(i, j) < "H" Then
ActiveCell.Offset(i, j).FormulaR1C1 = _
"=sum(Person1:Person16!R" & i & "C" & j & ")"
End If
Next j
Next i
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Brad" wrote:

The line with activecell.formula is not correct. What I'm trying to do is to
add up the time for person 1-16 on the total page if the date isn't a holiday.

Sub TotalThemUp()
Dim i As Long
Dim j As Long
Range("startpoint").Select
Range("B11:AF22").ClearContents
For i = 1 To 12
For j = 1 To 31
If ActiveCell.Offset(i, j) < "H" Then
ActiveCell.Formula&"R"&i&"C"&j =
"=sum(Person1:Person16!)"&"R"&i&"C"&j
End If
Next j
Next i
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Hopefully a real easy vba question

Thanks - so close

Thanks for providing an example on the format to use. Made the necessary
adjustment and got what I needed....

Thanks again!!

"Luke M" wrote:

I believe you are wanting multiple formulas as an output in the range of
B11:AF22?
Corrected syntax:

Sub TotalThemUp()
Dim i As Long
Dim j As Long
Range("startpoint").Select
Range("B11:AF22").ClearContents
For i = 0 To 11
For j = 0 To 30
If ActiveCell.Offset(i, j) < "H" Then
ActiveCell.Offset(i, j).FormulaR1C1 = _
"=sum(Person1:Person16!R" & i & "C" & j & ")"
End If
Next j
Next i
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Brad" wrote:

The line with activecell.formula is not correct. What I'm trying to do is to
add up the time for person 1-16 on the total page if the date isn't a holiday.

Sub TotalThemUp()
Dim i As Long
Dim j As Long
Range("startpoint").Select
Range("B11:AF22").ClearContents
For i = 1 To 12
For j = 1 To 31
If ActiveCell.Offset(i, j) < "H" Then
ActiveCell.Formula&"R"&i&"C"&j =
"=sum(Person1:Person16!)"&"R"&i&"C"&j
End If
Next j
Next i
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
The real Horizontal Formula question Melissa in Salem Excel Discussion (Misc queries) 4 June 14th 09 02:06 AM
Easy question M&M[_2_] Excel Discussion (Misc queries) 3 August 11th 07 07:00 AM
Macro Help, Real Easy comotoman Excel Discussion (Misc queries) 4 January 30th 06 03:43 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
Question for the real experts! diepenbos Excel Discussion (Misc queries) 2 March 16th 05 03:21 PM


All times are GMT +1. The time now is 02:40 PM.

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

About Us

"It's about Microsoft Excel"