0
votes

I've tried to find this answer, but am not really sure what to search for. I have some Excel macros that edit multiple sheets: (e.g. Copy cells from sheet 1, paste onto the end of a list on sheet 2, then put an "X" next to the cells on Sheet 1 and offset to the next row)

My issue is that when I run the macro, it spazzes out, switching the display back and forth between sheets 1 and 2. I can't just cite a specific range (e.g. sheets("Sheet 1").range("c2").dosomething) because the locations are changing. It wouldn't be an issue, but the other users who access the sheet aren't familiar with macros/VBA, and they think something is broken.

In short, the macros do what I want, but it looks really tacky. Is there a way to dynamically work across sheets without changing the displayed sheet/range?

1
'Application.ScreenUpdating = False' is a good start.Stef Joynson
I can't just cite a specific range (e.g. sheets("Sheet 1").range("c2").dosomething) because the locations are changing. Sounds like a good case to open a new question, post your existing code & some sample data and get some guidance on how to resolve that. Can almost guarantee that with some help & guidance you'll get it sorted out.FreeMan
No, it's just that as users alter data, the location of the range to edit is changing because of their input on multiple sheets. Again, I have the macros and issues all worked out, this is purely an aesthetic question. But You've all been most helpful!C-Love511

1 Answers

2
votes

Yes, you can turn off screen updating before performing any actions.

Application.ScreenUpdating = False

'Do your manipulation here

Application.ScreenUpdating = True