• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro Error

davinosky

New Member
Hello Everybody!


I'm a student of Online Excel/VBA School from this site.


I made an Excel/VBA file to generate sales forecast. The file is working perfectly in my PC, but in others PC, with same office version, it's not working.


I really need some help with that.


Thank you!
 
Hi, davinosky!

Adding to what b(ut)ob(ut)hc posted, it'd be easier if we knew what doesn't work. There might be multiple causes, macros disabled, calculation mode, other files missing, fixed references to folder/files... a bunch of causes. So if nothing works, consider uploading the file.

Regards!
 
This is the Excel/VBA file: http://bit.ly/MItBZt


The password to enable book en see the vba code es pdpx1x
 
Hi, davinosky!


Downloaded your file, tested Hide and Reset command buttons and everything worked.


Gave a look to your code, nothing wrong neither. So I don't know what to say, no external files, no other source data, no data connection links, so definitively issues of deployed machines.


What to check on each machine?

1) first, Excel version

2) as b(ut)ob(ut)hc said, if macros allowed

3) calculation mode (Alt-F11, Immediate window pane, "Print Application.Calculation = xlCalculationAutomatic" (unquoted), if false, then assign without "Print"

4) as I couldn't reproduce the raised error, it'd be useful if you try to describe what error appears, when, and if it displays any message


A humble suggestion for your code:

a) use "Option Explicit" statement always in all sheets and modules and forms code sections

b) reduce procedure (Sub and Function) scope to minimum possible: if Esconde_filas and Reset are in same module and are called from same places, both should be either Public or Private or nothing, but equal

c) same congruence for messages: if displaying "Listo", do it always or never but not once yes and once not; perhaps a "Beep" (unquoted, function) replaces the message box and doesn't need user intervention to go on working

d) in long processes or not so long but when screen blinks a lot as in this case, you might want to add this statements at the start and end of the procedures:

Application.ScreenUpdating = False

Application.ScreenUpdating = True

which prevents user from seeing what happens behind the scene


Just advise if any issue.


Regards!


PS: BTW, welcome another Spanish user to this community, and now we are... more! (than before)
 
Hi SirJB7


Thank you so much for your help and suggestions!

-Muchas gracias por su ayuda y sugerencias!-


Basicly, the error is that in others machines, when users click on "Reset", the macro hide all rows from 10 until 40.


I have column "J" to identify all days:

Number 7 = Sundays

Number 8 = for excess days.


Hide Botton
: must Hide all sundays of month.

Reset Botton
: must un-hide sundays, clean cells, find manager's store and find Plan.


I'm going to check all your points. ;-)


Regards from Dominican Republic! :)
 
Hi, davinosky!

Glad you solved it. Thanks for your feedback and for your kind words too. Welcome back whenever needed or wanted. And just advise if any doubt.

Saludos desde Argentina!
 
Hi, davinosky!


I was wondering about the Excel versions and regional settings configuration of those machines. Maybe they're other than Spanish Excel and date format dd/mm/yyyy?


If so, you can try modifying formulas (which I haven't noticed before) as:


a) column B: if you want to keep it...

B10

by

FILA()-9 -----> in English: ROW()-9

then delete B column (actually after next point)


b) column C: it's a string not always interpreted as a valid text value

=B10&"/"&D$7&"/"&$E$7

by

=FECHA($E$7;COINCIDIR($D$7;meses;0);FILA()-9) -----> in English: =DATE($E$7,MATCH($D$7,meses,0),ROW()-9)

and format range as "dd/mmmm/yyyy" for similar display (check if need to adjust format in code)


Give it a try and advise if any doubt.


Regards!
 
THANK YOU SO MUCH!!! Now it is working perfectly!! :-D


I made exactly what you said and a little more:


A) Column C: =FECHA($E$7,COINCIDIR($D$7,meses,0),FILA()-9)


B) Column J: =SI(C10<=FIN.MES($C$10,1-1),DIASEM(C10,11),8)


I really love this forum!!!


Regards!! :)
 
Back
Top