0

I did not use VBA for a while and I have an error 1004 when using this very simple command. I don't know what I have wrong there as it is very basic. (the range "start" is defined in the sheet "Output")

thanks a lot for your help

Sub simple()
    Dim under_unit As Variant
    under_unit = ThisWorkbook.Worksheets("Output").Range("start").Value
End Sub
2
  • What's the error of the text message? Commented Jun 8, 2016 at 18:26
  • Are you sure the named range is in the worksheet scope and not the workbook scope? Commented Jun 8, 2016 at 19:06

1 Answer 1

0

'make sure you have named the cell as: start; and the tab as: Output

Sub simple()

    Dim under_unit As Range
    Set under_unit = ThisWorkbook.Sheets("Output").Range("start")

    under_unit.Value = "solved"

End Sub
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.