Hello guys, can you please help me ??
I have function to create sum, but I need to modify a little bit.
1) I woul like to change "=sum(" to "=subtotal(9;" but I get error message. What is the problem ?
2) I need put into subtotal selected area. How to do it ?
Working macro:
Error macro:
I have function to create sum, but I need to modify a little bit.
1) I woul like to change "=sum(" to "=subtotal(9;" but I get error message. What is the problem ?
2) I need put into subtotal selected area. How to do it ?
Working macro:
Code:
Sub SUBTOTAL2()
'funguje
Dim myValue As Variant
Dim myValuee As Variant
Dim myValueee As Variant
myValue = InputBox("Cell to put SUBTOTAL: A1", "GleedsTool", "L66")
myValuee = InputBox("First Cell: A1", "GleedsTool", "M50")
myValueee = InputBox("Last Cell", "GleedsTool", "M55")
Range(myValue).Select
ActiveCell.Formula = "=sum(" & myValuee & ":" & myValueee & ")"
End Sub
Error macro:
Code:
Sub SUBTOTAL2()
'funguje
Dim myValue As Variant
Dim myValuee As Variant
Dim myValueee As Variant
myValue = InputBox("Cell to put SUBTOTAL: A1", "GleedsTool", "L66")
myValuee = InputBox("First Cell: A1", "GleedsTool", "M50")
myValueee = InputBox("Last Cell", "GleedsTool", "M55")
Range(myValue).Select
ActiveCell.Formula = "=subtotal(9;" & myValuee & ":" & myValueee & ")"
End Sub