Hi,
I have two sheets: Sheet1 and Sheet2. There is a macro for Sheet1 which needs to refer to a cell A1 in Sheet2. What is the code for the reference to Sheet2? I tried ...Sheets("Sheet2").Range("A1").Value, but not working.
Hi,
I have two sheets: Sheet1 and Sheet2. There is a macro for Sheet1 which needs to refer to a cell A1 in Sheet2. What is the code for the reference to Sheet2? I tried ...Sheets("Sheet2").Range("A1").Value, but not working.
Hi - A sample code to pull value of sheets 2 into any cell in Sheet1:
Hope you are able to modify this as per your needs.![]()
Sub Test() Range("A1") = Worksheets("Sheet2").Range("C7") End Sub
If solved kindly remember to mark Thread as solved.
Click the small star icon at the bottom left of my post if this was useful.
Hello zjianguk,
I think it may depend on various factors. If Sheets("Sheet2") is in fact Sheet 2, it should work, otherwise it would be better if you could upload a sample WorkBook, with your Code, for us to have a look at.
Please consider:
Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
Complete agree and second Winon's thoughts. Worksheet names while using macros could be tricky at times.
Thanks for your offer to help, Winon![]()
Hello zjianguk,
You are welcome.
Mind sharing with us how you got your issue resolved?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks