In my Active worksheet, I have the following code; If Target.Address = "$B$3" Then…
- User
In my Active worksheet, I have the following code; If Target.Address = "3" Then Sheets("Job Request").Activate End If What I would like to do is this, when the code runs then the value of cell A1 in sheet 'Job Request' becomes the value of B1 from my Active Sheet. Something like this; If Target.Address = "3" Then ActiveSheet.Range("B2").copy values only Sheets("Job Request").Activate ActiveSheet.Range("A1").paste values only End If
How can I do this
- Assistant
You can achieve this by using the
CopyandPasteSpecialmethods. Here's an updated version of your code:If Target.Address = "$B$3" Then ActiveSheet.Range("B2").Copy Sheets("Job Request").Activate ActiveSheet.Range("A1").PasteSpecial xlPasteValues End IfIn the code above, the value of cell B2 in the active sheet is copied using the
Copymethod. Then, the code activates the "Job Request" sheet and pastes the copied value into cell A1 using thePasteSpecialmethod with thexlPasteValuesparameter, which pastes only the values without any formatting or formulas.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.