We help IT Professionals succeed at work.

vba code Range error

157 Views
Last Modified: 2017-05-01
Hi,
I am getting an error:
Method 'Range' of object '_Global' failed
Sub Button4_Click()

Dim i, ctr As Integer
Sheets("S").Select
ctr = 1
For i = 1 To 2
    Range("Run").Value = ctr
    Calculate
    
    Sheets("inputs").Select
    Range(Sheets("S").Cells(i + 6, 2)).Value = Worksheets("inputs").Range("G51").Value

ctr = ctr + 1
Next i
End Sub

Open in new window

Comment
Watch Question

Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Which line? If it's 7 do you have a named range called "Run"? If it's 11 is your sheet name "inputs" or "Inputs"?
Excel & VBA Expert
CERTIFIED EXPERT
Most Valuable Expert 2018
Awarded 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Roy CoxGroup Finance Manager
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Roy CoxGroup Finance Manager
CERTIFIED EXPERT

Commented:
Pleased to help
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.