Link to home
Start Free TrialLog in
Avatar of John Carney
John CarneyFlag for United States of America

asked on

Is it possible with VBA to make A1 the active cell in a sheet without activating the sheet?

Is it possible with VBA to make A1 the active cell in a sheet without activating the sheet? If so, how? I have a macro that copies and pastes charts into multiple sheets in an external workbook, and then activates the external book. I would like to deselect the pasted charts just because I don't like the way that looks when I select the sheet for further work later.

Thanks!
John
SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Carney

ASKER

That's intriguing, MacroShadow. How would i incorporate this into my code below? The last line pastes the chart where I want it without activating Workbooks(wb), but it pastes it as a picture, which doesn't look as good aesthetically as the actual chart does. I couldn't find any PasteSpecial option for pasting objects.
        ActiveSheet.ChartObjects("Chart 2").Activate
        Set targCel = Workbooks(wb).Sheets(ShNm).Range("C3")
        ActiveChart.ChartArea.Copy
        targCel.PasteSpecial xlPasteAll

Open in new window

In any event, assuming that the topLeftCell of my chart is B2 (if that's relevant), how would your code work with my code?

Thanks,
John
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi MacroShadow, I tried it but I get an error. Let me work with it a little more when I have more time and I'll get back to you.

Thanks,
John
I haven't been able to make anything work but I want to reward you all for posting answers and close out the question.   Thanks!  John
If you can show us the code that you used and describe what's wrong with the results (if any) maybe one of us can help.