Thread: Call
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Edmund Edmund is offline
external usenet poster
 
Posts: 62
Default Call

Hello

Let me tell u my full scenario. Perhaps u can suggest how can I achieve it.

At work, I download query reports (database) into Excel file. Everyday, I hv
to download 5 reports. (Note : I store all the 5 downloaded reports in 5
separate Excel sheets but they are all under 1 single Excel file).

What made life difficult was that the reports are haphazardly formatted &
delimited(with lots of spaces & weird random formatting). Instead of spending
time daily in adjusting manually for each sheet, I attempted to compile 5
different macro procedures to rectify each sheet's data.

Let's say:
Sheet1 hold data for Purchase Price
Sheet2 holds Vendor Information
Sheet3 holds Contract Information
Sheet4 holds Overdue P/O
Sheet5 holds Outstanding Production Backlog

My 5 macros are tailored to cater for rectification for each sheet. But to
select & press the button in ToolsMacro to execute the codes daily, risks
accidental execution. To make life easier, I'm tyring to derive a macro that
will "take the active sheet's name so as to use that name as the guide for it
to grab the correct procedure to execute". That's why in VBE , procedure
inside "Sub Sheet1()" is intended to rectify Sheet1's inconsistency".

In short, I just need a procedure that will take the name of the active
sheet, & use that name to trigger the right macro that is intended for that
specific sheet. When this is successful, I can rest my worries as I only need
to run 1 single macro, where this macro will trigger the execution of the
right procedure of the 5 procedures in hand.

I'm a VBA rookie. Very very raw to VBA.

--
Edmund
(Using Excel XP)