The answer would be Yes, you can combine multiple sub-routines in to one.
However, you need to know what exactly you want to achieve before putting
them together. In your case, you have three routines, but all of them do
not actually produce an output, although they are performing some (similar)
actions. What do you want the macro to do is the question, and then you'll
know how to put them together.

Another point to keep in mind is that, a lot of recorded macro is
superfluous. You will in time learn to take out a lot of redundancies.
However, just to give you a slight idea of taking out redundant
code....look at the lines below

Range("A1").Select
Selection.Value = "Muneer"
Selection.Offset(1,0).Select

Look at all those superfluous selection action

Now, you could actually write this as Range("A1").Value = Muneer

and the next line is just a waste of resources as far as the developer is
concerned. It is just performing an action, but there is no output. Unless
you specifically need to select the next cell in that column, you can take
out that code, which is redundant.

Regards,

Sam Mathai Chacko

On Tue, Feb 7, 2012 at 7:34 PM, Mohammed Muneer <mmun...@ccc.com.qa> wrote:

>  <<Grm.xls>>
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5)  Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE  : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>



-- 
Sam Mathai Chacko

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to