PDA

View Full Version : Solved: Macro hangs and need an extra step add to the macro



keilah
05-16-2008, 05:49 AM
Firstly let me highlight a slight problem that might need correcting before we can being......At present if the user click the "Delete Supplier" macro button on worksheet "Deal Selecton" IT HANGS....this is because it is step up to look for a corresponding worksheet.

So if i was to delete Repsol then > it would also delete the worksheet Repsol.....if there is no worksheet of that name present in the workbook IT HANGS........

1. So is it possible to delete what ever supplier name the user selects (worksheet "Deal Selection" column B) irrespective or not a worksheet of that name is in the workbook.....if the workbook is present then also delete it too.

2. KNOW if i delete a supplier name from column B worksheet "Deal Selection" then >

I also want to remove from the following worksheets (Allocaction (base) + (Vol) +(Sc.1) + (Sc.2) and (Sc.3) - for agrument shake

Say i was to delete Repsol from Column B then > also delete from the above mentioned worksheet Repol from column B:E in worksheets (Allocaction (base) + (Vol) +(Sc.1) + (Sc.2) and (Sc.3)........

See highlight data as a guide.......

Thi question is also posted on link: http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_23407697.html

Simon Lloyd
05-16-2008, 09:09 AM
Keliah, you have a solution at Experts Exchange, however, you have to pay for it!

keilah
05-16-2008, 01:01 PM
yes that is true and no answer....sometime you have to go back to your roots to find a solution to the problem.........i am guessing that they are not up to it.......

keilah
05-17-2008, 12:50 PM
can this be done???????

rbrhodes
05-18-2008, 03:41 AM
Hi,

Did you see the answer at EE? (Thanks but no thanks...) I saw this question there a while ago and even considered it myself, briefly.

Yes it can be done... but probably not for free - It's just way too much work!

I can see what you're trying to do but the code is a bit of a mess and would have to be fixed and debugged before anything could really happen.

I'm guessing that's what Simon means when he says "you'll have to pay for it"

Just my 2 cents worth <G>

keilah
05-18-2008, 04:47 AM
Can some please delete this question for me...

Thanks

Bob Phillips
05-18-2008, 05:10 AM
... (Thanks but no thanks...) ...

Does that refer to EE?

keilah
05-18-2008, 05:17 AM
this question has already been deleted from EE.....not sure how to close it on this forum

Bob Phillips
05-18-2008, 05:21 AM
Just marked it as Solved, it will soon drop off.

Simon Lloyd
05-18-2008, 11:18 AM
I'm guessing that's what Simon means when he says "you'll have to pay for it"

Just my 2 cents worth <G>rbrhodes, i wasn't being bloody minded, i don't belong to EE but i do know that if you post a question and want to view the solution "you have to pay for it". I havent seen the original workbook or code but if its as bad as you say surely it would be better starting a new?, that way sensible portioned questions could be asked without the size of the task putting off people giving free help.

rbrhodes
05-19-2008, 03:09 AM
Hello all,

Firstly, apologies to Simon. I don't know what "bloody minded" means exactly but I can imagine its not good. Sorry for any perceived insult.

I am, and have been a member of EE for a long time (I guess I got in while the getting was good, ie free) and contributed there regularly. I was actually 'recruited' from there by Dreamboat to here...way back when.

I've written yards of code for free for users at EE, VBAExpress, OzGrid, ExcelForum, etc.

My point being is that I had already looked at the EE post and passed on it.

Having discovered what I thought was an interesting problem (again) here, I looked at the Xpost at EE and recognized it, of course.

So I logged in and viewed the 'solution'. The solution was, as I tried to say in my previous post, essentially: "Thanks but no thanks. Sorry."

I would post the 'solution' here but I'm not sure that's good form. Anyways: no solution just comments on the code and the amount of time it would take to rebuild it, etc. All totally valid BTW.

As for "starting anew" I just attemped that... 13 hours of programming and I think I'm close. Too much fun!



Ahh... Just attempted to open the fle to attach it here. Gone!

Here's the Message:

Microsoft Excel File Repair Log

Errors were detected in file 'C:\Documents and Settings\dr\My Documents\keilah by dr.xls'
The following is a list of repairs:
Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.

And the result is a bare bones file with no formatting, userforms or VBA! Now I truly see what the EE message was about! 13 hours of programming, carefully saving after every change of code and *poof*


keilah, "Life is interesting if you're nae weak.!"

I'll look at it again tomorrow...

Simon Lloyd
05-19-2008, 08:41 AM
rbrhodes, "Bloody minded" means having no understanding of anyone else and believing your view is correct!

13 hours? far too much, i understand your dedication and perhaps intrest but thats a paying job way beyond the free help margin!

rbrhodes
05-19-2008, 12:52 PM
Hi,

Simon, I started my original post by asking whether you had seen the file and/or the EE solution. Somehow I decided that you had and that you concurred with the opinion at EE, Sorry about that, I think that's where the misunderstanding came from. I certainly wasn't implying "bloody mindedness"! (Thanks for the explanation)

Yes too many hours! I took it upon myself to understand All of the code so that writing a solution didn't mess up something else. It's a rather large code base so that took a while - not to mention translating some R1C1 for my feeble brain!

Of course I also inserted 'Option Explicit', dimmed all the variables, built two new forms to replace the InputBoxes, etc. A job really but I enjoy a challenge!

Imagine my surprise when I decided it was in a somewhat finished state only to open the file and it was all gone!!!!!! Saving a file doesn't mean you'll ever see it again. Lesson learned.

1) Save your work
2) Save it as a different name
3) Save it again, repeat.
4) EXPORT your modules

Perhaps that way I would have got the code back at least.

Fairly basic <g> lesson that I've learned many times about files themselves - first time for code. So "All's well that ends."