Posts by tarekrifai

    i Created a sheet that dynamically insert column based on different Cell Values but am not able to Sum the data


    code [VBA]Sub LoopDates()


    With Sheets("OrderReview")
    lastCol = Cells(2, .Columns.Count).End(xlToLeft).Column - 1


    Range("Q1:CL1") = "=WEEKNUM(R[1]C)&YEAR(R[1]C)"
    Rows("1:1").Select
    Selection.Font.Bold = True


    For a = lastCol To 17 Step -1
    If Cells(1, a) <> Cells(1, a - 1) Then
    Application.DisplayAlerts = False
    .Columns(a).Insert
    .Columns(a).ColumnWidth = 12
    .Cells(Rows.Count, a).End(xlUp).Borders(xlEdgeRight).LineStyle = xlContinuous
    .Cells(2, a).Value = .Cells(2, a + 1).Value
    .Cells(1, a).Value = "=WEEKNUM(R[1]C)&YEAR(R[1]C)"
    .Cells(1, a).Font.Bold = False
    .Cells(2, a).Font.Bold = False
    End If
    Next a



    End With



    Application.DisplayAlerts = True
    End Sub[/VBA]


    i want to sum all data in rows
    Note: Un-Bold Fields are Inserted By Macro
    i need to Sum All Data in Rows after inserting the Column ( Sum all With Row1 = 482018)
    your help is appreciated


    Sum(all Rows That has same ROW1 )


    [ATTACH=JSON]{"alt":"Click image for larger version Name:\tSample.jpg Views:\t2 Size:\t115.0 KB ID:\t1208105","data-align":"none","data-attachmentid":"1208105","data-size":"full","title":"Sample.jpg"}[/ATTACH]

    i need to create a report to Sum Data in based on Weeks


    am not able to insert Columns Dynamically between dates


    dates changes dynamically and could be less than that total number of columns ...


    From Q2 till CO2 its All the Range Of Dates by Day .


    am Trying to insert a Column between dates separating based on Weeks and Sum Rows Details


    Eg:


    At Q2 = 06-Sept-18
    increments till CO = 06-Dec-18


    i want it to insert the new column as Calendar Week ( W35,W36 ...)
    and Sum all Data under it


    hope i made it clear ...

    Really Appreciate Helping In This


    I Have Sheet were i Need to Enable Rows IF The Column Value is YES in Dynamic Value Change...


    i have the Code Working But its Columns by Column where it Executes so Slowly.


    [VBA]
    Code Below :


    Private Sub Worksheet_Change(ByVal Target As Range)


    If UCase(Range("B6")) = "YES" Then

    ActiveSheet.Unprotect Password:="Secret"
    [B7:B25].Locked = False
    ActiveSheet.Protect Password:="Secret"
    Else
    ActiveSheet.Unprotect Password:="Secret"
    [B7:B25].Locked = True
    ActiveSheet.Protect Password:="Secret"
    End If
    ' .... Till This Colum


    If UCase(Range("AC6")) = "YES" Then


    ActiveSheet.Unprotect Password:="Secret"
    [ac7:ac25].Locked = False
    ActiveSheet.Protect Password:="Secret"

    Else


    ActiveSheet.Unprotect Password:="Secret"
    [ac7:ac25].Locked = True
    ActiveSheet.Protect Password:="Secret"

    End If



    End Sub


    [/VBA]


    How Could i use dynamic Column / Row Enabling instead of Column By Column Check


    Thanks For Help