Hi Azhar,

Try this revised version...

Sub InsertColumnWithFormula()
    Const lngNoOfCol                As Long = 2
    Dim varSheets()                 As Variant
    Dim lngLoop                     As Long
    Const strStartRange             As String = "R1"


    varSheets = Array("Sheet1", "Sheet2", "Sheet3")

    Application.DisplayAlerts = False
    Application.Calculation = xlCalculationManual
    Application.EnableEvents = False

    For lngLoop = LBound(varSheets) To UBound(varSheets)
        With ThisWorkbook.Worksheets(varSheets(lngLoop))
                .Range(strStartRange).Offset(, (lngNoOfCol - 1) *
-1).Resize(, lngNoOfCol).EntireColumn.Copy
                .Range(strStartRange).Offset(, 1).Insert Shift:=xlToRight
        End With
    Next lngLoop

    Application.CutCopyMode = False
    Application.EnableEvents = True
    Application.Calculation = xlCalculationAutomatic
    Application.DisplayAlerts = True
End Sub

Regards,
Lalit Mohan
Regards,
Lalit Mohan


On Fri, Jun 29, 2012 at 4:51 PM, NOORAIN ANSARI
<noorain.ans...@gmail.com> wrote:
> Dear Azhar,
>
> Please share sample workbook with Group.
>
>
> On Fri, Jun 29, 2012 at 4:38 PM, Azhar Rai <azhar....@gmail.com> wrote:
>>
>> Hello Dear Gurus
>>
>> I want to add columns in an excel sheet between R and AQ to be total in
>> number as in cell H5 and I also want this to be replicated in sheet2,
>> sheet3, and sheet4 and these columns  should also carry the formula from
>> column R.
>>
>> Gurus please help me.
>>
>> Thanks
>>
>>
>> --
>> 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
>>
>> To unsubscribe, send a blank email to
>> excel-macros+unsubscr...@googlegroups.com
>
>
>
>
> --
> Thanks & regards,
> Noorain Ansari
> www.noorainansari.com
> www.excelmacroworld.blogspot.com
>
>
>
>
> --
> 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
>
> To unsubscribe, send a blank email to
> excel-macros+unsubscr...@googlegroups.com

-- 
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

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com

Reply via email to