VBA Question

P

PeCoNe

Hallo,

If i insert 2 columns in my sheet, before a column used in my vba, excel
crashes and restarts.
Is that a known problem?

Peter
 
G

GS

Hallo,
If i insert 2 columns in my sheet, before a column used in my vba,
excel crashes and restarts.
Is that a known problem?

Peter

Needs lots more info to give you a good answer. But just for
starters.., how does VBA ref the columns existing prior to inserting
new ones (regardless of where you insert). Depending on how the ranges
are refered to, Excel will definitely throws exceptions at every ref
that's no longer fully qualified to its associated object.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
B

bojan0810

Dana Äetvrtak, 19. rujna 2013. 11:40:41 UTC+2, korisnik PeCoNe napisaoje:
Hallo,



If i insert 2 columns in my sheet, before a column used in my vba, excel

crashes and restarts.

Is that a known problem?



Peter

If I understand right... If you have macro that is using for example columnC, and if you insert 1 or more columns before C, macro will still use column C but this time its using empty column what you inserted and thats why you get errors or crashes. There are probably some data in that column what macro needs and when you insert empty one, macro is getting "confused". To fix that change macro code, somewhere you have that column in code and justreplace it with other column, depends if "used" column is C then just replace it with other column where it supposed to be. So if you insert 2 columnbefore "used" C then change C into F (2 columns after) and so on.
I hope that this will help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top