pir81
07-23-2011, 05:58 PM
Hi,
I am totaly new to VBA. What I want to do is have one work sheet that sums up all the other work sheets (their number is variable)
So in the summed worksheet cell A5 includes all the A5s from the others (once the formular is in place in one cell I can copy paste it across the sheet).
The formular should look like this
if(ISNUMBER(Sheetx!A5),A5,0)+
if(ISNUMBER(Sheety!A5),A5,0)+
if(ISNUMBER(Sheetz!A5),A5,0) etc
Can someone help me?
I tried pasting it together (by the way I want to leave out the first 3 sheets out of the calculation), but am stuck:
Sub Q4_detailed_update()
For i = 1 To Sheets.Count
If Sheets(i).Name = "Sheet1" Or _
Sheets(i).Name = "Sheet2" Or _
Sheets(i).Name = "Sheet3" Or _
Sheets(i).Name = vbNullString Then
Exit
Else
' I assume here should be something like get current string and append new sheet formular, but here I am stuck
Next i
End Sub
Any help is appreciated.
Thanks
I am totaly new to VBA. What I want to do is have one work sheet that sums up all the other work sheets (their number is variable)
So in the summed worksheet cell A5 includes all the A5s from the others (once the formular is in place in one cell I can copy paste it across the sheet).
The formular should look like this
if(ISNUMBER(Sheetx!A5),A5,0)+
if(ISNUMBER(Sheety!A5),A5,0)+
if(ISNUMBER(Sheetz!A5),A5,0) etc
Can someone help me?
I tried pasting it together (by the way I want to leave out the first 3 sheets out of the calculation), but am stuck:
Sub Q4_detailed_update()
For i = 1 To Sheets.Count
If Sheets(i).Name = "Sheet1" Or _
Sheets(i).Name = "Sheet2" Or _
Sheets(i).Name = "Sheet3" Or _
Sheets(i).Name = vbNullString Then
Exit
Else
' I assume here should be something like get current string and append new sheet formular, but here I am stuck
Next i
End Sub
Any help is appreciated.
Thanks