Thread: [Solved] Help with Code
View Single Post
 
Old 02-08-2017, 09:20 PM
AJacLo AJacLo is offline Windows 10 Office 2016
Novice
 
Join Date: Feb 2017
Posts: 1
AJacLo is on a distinguished road
Default Help with Code

After I run this macro again, I get the same values. Can someone tell me how to reset the specified range "Table," so that I can add another range and calculate new values?


Code:
Sub MacroTry1()
'
' MacroTry1 Macro
Dim Specifiedrange As Range
Set Specifiedrange = Application.InputBox("Specify the range:", Type:=8)
Specifiedrange.Name = "Table"
ActiveCell.FormulaR1C1 = "=COUNTIF(Table,"">0"")"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=COUNT(Table)"
Range("F2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"
Range("D3").Select
End Sub

Last edited by macropod; 02-10-2017 at 11:17 PM. Reason: Added code tags
Reply With Quote