Macro Understanding

Hello Experts,
I'm very poor in Macros and would like understand the purpose of the MACRO Below.
TIA

Hi,
That was a quick reply, thanq so much, I got the logic now but I have a issue. Key figure "Market Demand Planner Forecast" has values for 12 periods and "Manual Adjustment by demand planner is blank for all the 12 periods.
However ,I'm not sure whats wrong with Macro..
For KF " Market Demand Planner Forecast, for a past period where value is 53004.76 its rounding off to 53004 , for future periods where value is 44379.02 is calculated to 44380 and 40065.632 is calculated to 40066.
What could be the logic ?
TIA

Similar Messages

  • PowerPoint using macro to delete text boxes after printing

    Hi,
    We created custom shows in Powerpoint and are running a macro to insert temporary page numbers on the slides before printing.  The issue is that I need to remove the page numbers after printing.  I'm a novice at VBA so I'm sure there is an easy
    solution, but nothing I've tried so far has been successful.  The code is displayed below for your reference.  Any help is greatly appreciated. Thanks!
    Sub PrintCustomShow()
          ' Change this number to specify your starting slide number.
          Const lStartNum As Long = 1
          ' Ask the user which custom show they want to print.
          Dim strShowToPrint As String, strPrompt As String
          Dim strTitle As String, strDefault As String
          ' See if any custom shows are defined.
          If ActivePresentation.SlideShowSettings.NamedSlideShows.Count _
             < 1 Then
             ' No custom shows are defined.
             ' Set up the string for the message box.
             strPrompt = "You have no custom shows defined!"
             ' Display the message box and stop the macro.
             MsgBox strPrompt, vbCritical
             End
          End If
          ' Find the page number placeholder; if found, pick up the style.
          Dim rect As PageBoxSize
          Dim oPlaceHolder As Shape
          Dim bFound As Boolean: bFound = False
          For Each oPlaceHolder In _
             ActivePresentation.SlideMaster.Shapes.Placeholders
             ' Look for the slide number placeholder.
             If oPlaceHolder.PlaceholderFormat.Type = _
                ppPlaceholderSlideNumber Then
                ' Get the position of the page number placeholder.
                rect.l = oPlaceHolder.Left
                rect.t = oPlaceHolder.Top
                rect.w = oPlaceHolder.Width
                rect.h = oPlaceHolder.Height
                ' Get the formatting of the slide number placeholder.
                oPlaceHolder.PickUp
                ' Found the slide number placeholder, so set the
                ' bFound boolean to True.
                bFound = True
                Exit For
             End If
          Next oPlaceHolder
          ' See if a slide number placeholder was found.
          ' If not found, exit the macro.
          If bFound = False Then
             ' Unable to find slide number placeholder.
             MsgBox "Your master slide does not contain a slide number " _
                & "placeholder. Add a " & vbCrLf & "slide number placeholder" _
                & " and run the macro again.", vbCritical
             End
          End If
          ' Set up the string for the input box.
          strPrompt = "Type the name of the custom show you want to print." _
             & vbCrLf & vbCrLf & "Custom Show List" & vbCrLf _
             & "==============" & vbCrLf
          ' This is the title of the input box.
          strTitle = "Print Custom Show"
          ' Use the first defined show as the default.
          strDefault = _
             ActivePresentation.SlideShowSettings.NamedSlideShows(1).Name
          ' Obtain the names of all custom slide shows.
          Dim oCustomShow As NamedSlideShow
          For Each oCustomShow In _
             ActivePresentation.SlideShowSettings.NamedSlideShows
             strPrompt = strPrompt & oCustomShow.Name & vbCrLf
          Next oCustomShow
          Dim bMatch As Boolean: bMatch = False
          ' Loop until a named show is matched or user clicks Cancel.
          While (bMatch = False)
             ' Display the input box that prompts the user to type in
             ' the slide show they want to print.
             strShowToPrint = InputBox(strPrompt, strTitle, strDefault)
             ' See if user clicked Cancel.
             If strShowToPrint = "" Then
                End
             End If
             ' Make sure the return value of the input box is a valid name.
             For Each oCustomShow In _
                ActivePresentation.SlideShowSettings.NamedSlideShows
                ' See if the show is in the NamedSlideShows collection.
                If strShowToPrint = oCustomShow.Name Then
                   bMatch = True
                   ' Leave the For loop, because a match was found.
                   Exit For
                End If
                ' No match was found.
                bMatch = False
             Next oCustomShow
          Wend
          ' Get the array of slide IDs used in the show.
          Dim vShowSlideIDs As Variant
          With ActivePresentation.SlideShowSettings
              vShowSlideIDs = .NamedSlideShows(strShowToPrint).SlideIDs
          End With
          ' Loop through the slides and turn off page numbering.
          Dim vSlideID As Variant
          Dim oSlide As Slide
          Dim Info() As SlideInfo
          ' Make room in the array.
          ReDim Preserve Info(UBound(vShowSlideIDs) - 1)
          ' Save the current background printing setting and
          ' then turn background printing off.
          Dim bBackgroundPrinting As Boolean
          bBackgroundPrinting = _
             ActivePresentation.PrintOptions.PrintInBackground
          ActivePresentation.PrintOptions.PrintInBackground = msoFalse
          ' Loop through every slide in the custom show.
          Dim x As Long: x = 0
          For Each vSlideID In vShowSlideIDs
             ' The first element in the array is zero and not used.
             If vSlideID <> 0 Then
                ' Add slide ID to the array.
                Info(x).ID = CLng(vSlideID)
                ' Get a reference to the slide.
                Set oSlide = ActivePresentation.Slides.FindBySlideID(vSlideID)
                ' Store the visible state of the page number.
                Info(x).IsVisible = oSlide.HeadersFooters.SlideNumber.Visible
                ' Turn off page numbering, if needed.
                If Info(x).IsVisible = True Then
                   oSlide.HeadersFooters.SlideNumber.Visible = msoFalse
                End If
                ' Create a text box and add a temporary page number in it.
                Dim oShape As Shape
                Set oShape = _
                   oSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, _
                                            rect.l, rect.t, _
                                            rect.w, rect.h)
                ' Apply the formatting used for the slide number placeholder to
                ' the text box you just created.
                oShape.Apply
                ' Add the page number text to the text box.
                oShape.TextFrame.TextRange = CStr(x + lStartNum)
                ' Increment the array element positon.
                x = x + 1
             End If
          Next vSlideID
    ' Print the custom show. NOTE: You must turn background printing off.
                 With ActivePresentation
                 With .PrintOptions
                 .RangeType = ppPrintNamedSlideShow
                 .SlideShowName = strShowToPrint
                 End With
                 .PrintOut
                End With
          ' Restore the slide information.
          For x = 0 To UBound(Info)
             ' Get a reference to the slide.
             Set oSlide = ActivePresentation.Slides.FindBySlideID(Info(x).ID)
             oSlide.HeadersFooters.SlideNumber.Visible = Info(x).IsVisible
          Next x
          ' Restore the background printing setting.
          ActivePresentation.PrintOptions.PrintInBackground = _
             bBackgroundPrinting
       End Sub

    Hi hlolrich,
    According to the description, you want to remove the shapes which created after you print the presentaion.
    I suggest that you name the shape you added with some rule, then we can delete thease shapes via the name rule.
    And here is a sample that you delete the shapes which name contains the
    myShape words on the first slide for your reference:
    Sub deleteShapes()
    For Each aShape In Application.ActivePresentation.Slides(1).Shapes
    If InStr(aShape.Name, "myShape") Then
    aShape.Delete
    End If
    Next aShape
    End Sub
    Also you can learn more about PowerPoint developing from link below:
    How do I... (PowerPoint 2013 developer reference)
    PowerPoint 2013
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Where can I find a macro I can use in Project Properties to generate PDB files of different filenames each build?

    Found a better solution. The answer is given at the very bottom of this post.
    I'm looking for $(Random), %(Date), %(Time), or some %(Value) that I can put in the "Generate Program Database File" entry.
    Like "$(TargetDir)_%(CreateTime).pdb".
    But the problem is, %(CreateTime), %(ModifiedTime), and %(AccessTime) has colons in them, making them useless when putting them into the filenames.
    What other ways can I generate PDB files of different file names? Or, how do you modify %(CreateTime) so that I can remove the colons and just obtain the numeric values?

    Hi Tom_mail78101,
    It seems that there is no built-in macro for renaming the PDB files randomly.
    You could submit this feature request:
    http://visualstudio.uservoice.com/forums/121579-visual-studio
    The Visual Studio product team is listening to user voice there. You can send your ideas/suggestions there and people can vote.
    I agree with Viorel. The possible way to rename the PDB files is that you write your own script to rename the PDB file after building the project and put the script to Post-Build event in Build Event. As for whether this way can accomplish it, you can try
    to consult on: MSBuild
    forum like this thread: https://social.msdn.microsoft.com/Forums/vstudio/en-US/bcf39fd6-0e0c-4486-9438-7a724ded44de/postbuild-event-command?forum=msbuild
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Will macros in excel work properly if I switch Office 2013 32 bit to Office 2013 64 bit?

    hi,
    Will macros in excel created with Office 2013 32 bit work properly if i switch to Office Execl 2013 64 bit?
    Thanks

    Hi,
    As far as I know, most of the macros might work well between 32bit and 64bit Excel. But there are some limitations for Excel 64bit:
    Solutions using ActiveX controls library, ComCtl controls won’t work.
    Third-party ActiveX controls and add-ins won’t work.
    Visual Basic for Applications (VBA) that contain Declare statements won’t work in the 64-bit version of Office without being updated.
      Compiled Access databases, like .MDE and .ACCDE files, won’t work unless they’re specifically written for the 64-bit version of Office.
    More reference:
    https://msdn.microsoft.com/en-us/library/ff700513(v=office.11).aspx
    https://msdn.microsoft.com/en-us/library/ee691831(v=office.11).aspx
    https://support.office.com/en-sg/article/Choose-the-32-bit-or-64-bit-version-of-Office-2dee7807-8f95-4d0c-b5fe-6c6f49b8d261?ui=en-US&rs=en-SG&ad=SG
    If you have any further question about macros, I recommend you post the question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to delete empty coulums in Excel using Macro

    Dear Users,
    i have prepared a very big excel file. actually this file is record of old prices and i vlook the the part number from different files and extract the old prices. some time there is no record so all the columns is empty. let me explain little more.....i
    have excel files by year 1992 To 2013. most of the times i have to vlookup the old prices, now for exampe one item we just sale in 94,97and 2007, but except these years all the columns of other years from 92 to 2013 are empty. one by one check them top to
    end and delete is very hard. is there any macro which checks the value from top to end, if there is no value so it delete all the coulum...........hope i could explain my question.................
    Best Regards
    Tahir Mehmood

    Hi,
    Please try this code:
    Sub DeleteBlankColumns()
    Dim c As Integer
    'declare c as variable for column number
    c = ActiveSheet.Cells.SpecialCells(xlLastCell).Column
    'save last column number in used range
    Do Until c = 0
    'Loop for each column number until it equals 0
    If WorksheetFunction.CountA(Columns(c)) = 0 Then
    'Check if entire column is blank
    Columns(c).Delete
    'if column is blank delete column
    End If
    'closes if statement
    c = c - 1
    'proceeds to the next lowest column number
    Loop
    End Sub
    PS:
    This is the forum to discuss questions and feedback for Microsoft Excel, if you have further question, please post the thread to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How can I write a script or create a macro for gaming.

    Now I know this may be a petty and or silly question for most apple users but I am going to throw it out there anyway. I play an online game called Battle Pirates. When you make an attack you have up to 5 ships to control. I am looking for a way to control multiple ships with a "macro" or "script" and using only 1 key. For example: Select ship 2, 3, and 4 while leaving ship 1 and 5 alone. Yea I know it is childish but indulge me. Hahaha.
    I know you can write Macros with Windows and you can even use something called "Auto Hotkey". I just wanted to see if anyone knew of a way to do this with what Apple already has in place. What I have commonly found out with Apple products is that since I have come from being a Windows user to Apple, I usually overthink the process. LOL. Mac's are soooooo much easier....if you know where to start.
    Any help would be greatly appreciated! By the way, I have read the tutorial on "Script Editor" but I am having trouble understanding it mostly because you kinda would have to have SOME programming knowledge. Obviously I lack in that area. Thanks for bearing with me.

    Can you expand on that? How do you use automator in your game? Can you give me a rough idea of how and what you do with it? I have watched a tutorial on Automator and it seems more useful for documents.

  • Issue in new macro calculating values in time series in CVC

    Hi friends.
    I'm new in APO.
    I have a problem with a new macro in CVC which calls up a FM to calculate and store data.
    This new macro calculates the selected data in time series (TS) and e.g. we select 3 days to make calculation with this macro, the first selected day in TS is ignorated.
    We created this macro to do this calculation when user enter some manual values and want it to be calculated in the deliver points in CVC, by TS.
    This macro calls up my Z function which internally calls up a standard FM '/SAPAPO/TS_DM_SET' (Set the TS Information).
    Sometimes, this FM, raises error 6 (invalid_data_status = 6), but only when I user 'fcode_check' rotine together.
    After that, we call the FM '/SAPAPO/MSDP_GRID_REFRESH' in mode 1 and 'fcode_check' rotine in program '/sapapo/saplmsdp_sdp'.
    Firstly, I thought it could be dirty global variables in standard FM so I put it inside a program and called it by submit and return command. But now I think could not be this kind of error because it did not work. And inverted the results, and now only first line os TS get storted and change in CVC.
    It's a crazy issue. Please friends. Guide me for a solution!
    thanks.
    Glauco

    Hi friend. Issue still without a correct solution yet.
    A friend changed the macro adding another step calling the same function. Now this macro has two calls in sequence to same FM. Now it's working, but we can't understand why it's working now.
    It's seems like dirty memory in live cash.
    Nobody knows how to solve this!
    Glauco.

  • Using a Macro to add a Carriage Return after each data entry within all cells of an imported range of cells

    I have a macro that copies data from a Target workbook then pastes the data into a destination workbook.  I then wish to use lookups in the destination workbook to view specific data from the pasted range of data on a separate sheet. 
    The problem is, the cells that contain numbers from the pasted data have the green dogeared error flags associated with the cell. The only way I can make a lookup function work, is to go to each cell and manually enter a carriage return after each entry. 
    The code for the macro is given below.  What can be done so that the pasted data contains no errors associated with the number cells?  Or can a second macro be written to clean the data.  If so can you help me out?  Thanks in advance.
    Kindest Regards
    Sub ImportData()
     ' ImportData Macro allows user to select an Excel workbook (i.e. Orchestrate Excel Output),
     ' then copy & paste it into the MediaSpreadsheet.
        Dim wbk As Workbook
        Set wbk = Application.Run("MediaSpreadsheet_1.0.xlsm!OpenFile")
        If wbk Is Nothing Then
            Beep
            Exit Sub
        End If
        Set wbk = ActiveWorkbook
        Range("A9:S116").Copy
        Workbooks("MediaSpreadsheet_1.0.xlsm").Activate
        Sheets("OrchestrateData").Select
        Range("A1").Select
        ActiveSheet.Paste
        With Selection.Font
            .ColorIndex = xlAutomatic
            .TintAndShade = 0
        End With
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        Selection.Borders(xlEdgeLeft).LineStyle = xlNone
        Selection.Borders(xlEdgeTop).LineStyle = xlNone
        Selection.Borders(xlEdgeBottom).LineStyle = xlNone
        Selection.Borders(xlEdgeRight).LineStyle = xlNone
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        wbk.Close
        Sheets("MediaSchedule").Select
    End Sub
    DAPulliam64

    Hi DAPAugust64,
    The green "dogeared error flags" of the cells means that you paste numbers in these cells, but they're formated as Text.
    So you need to change the cells back to the correct format so that the lookup function works fine. You can simply call this method after pasting:
    ActiveSheet.Cells(1, 1).NumberFormat = "General"
    ActiveSheet.Cells(1, 1) = ActiveSheet.Cells(1, 1).Text
    Or use PasteSpecial method to paste the numbers as well as it's format:
    https://msdn.microsoft.com/en-us/library/office/ff837425.aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Word for Windows with Macros can convert to mac

    I have a word document that was created on a PC with Windows.  It's a docm. file with macros (drop drown menus, scroll bars, and check boxes).  When I open in on my MAC, none of the macros are enabled.  They just become text boxes when I click
    on them.  How can I convert it over so I can use it on my MAC?  I'm using Word 2011 Version 14.4.1.  Any help would be greatly appreciated!!!

    Hi,
    For this question, I suggest you post the question to Office for Mac forum for support:
    http://answers.microsoft.com/en-us/mac
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank
    you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support

  • Macro Details in ABAP report

    Dear Friends,
    I would like to get a demand planning macro's detail in a ABAP report that I plan to develop manipulate the Macro attributes. My questions are:
    1. Is it possible to come up with a report like this
    2. If so, what is general approach to do the same  - any function module calls or any other ways of getting the macro details in the ABAP report?
    Thank you and Best Regards,
    Guru

    Hi Guru,
    For this requirement i think ABAP program is not required.you can do in macro itself in DP.
    As per my understanding i think you are trying to execute the macro step for the period current week + 1.
    If this is the case then With the ITERATION_COUNTER macro function, you can determine the value of the step counter, that is, the number of periods that have already been processed. For example, if you only want to process the third and fourth future periods, you can define a step that processes the entire future and use an IF statement to check within the step whether the step counter assumes the value three or four and only then execute the calculation.
    Note that changing macro attributes,activate using ABAP report is too complex .
    Hope this will helps you.
    Regards,
    Sunitha

  • Macro in ABAP Code

    Dear All,
    I am trying to debug a Macro in SAP standard Extractor. I am unable to understand the line in bold. following is the Macro code:
    DEFINE sel.
        when &1.
          sort s_t_select by fieldnm.        
          do.
            fetch next cursor g_cursor into id.
            if sy-subrc eq 0.
    <b>          import &2 from database &3(bw) id id.</b>   
          loop at &2.
                cond_select = true.
                loop at s_t_select.
    "delete" entry if select-option does not fit
                  assign component s_t_select-fieldnm of
                    structure &2 to <fs_field>.
                  if sy-subrc ne 0.
                    log_write 'E'          "message type
                              'MCEX'       "message class
                              '022'        "message number
                              i_isource    "message variable 1
                              s_estruc.    "message variable 2
                    raise error_passed_to_mess_handler.
                  endif.
             move-corresponding s_t_select to cond_select_tab.
             append cond_select_tab.
             at end of fieldnm.
                    if not <fs_field> in cond_select_tab.
                      cond_select = false.
                      refresh cond_select_tab.        
                      exit.
                    endif.
                   refresh cond_select_tab.           
                  endat.                              
                endloop.
                if cond_select eq true.
                  append &2 to e_t_data.
                  add 1 to counter.
                endif.
              endloop.
              if s_maximum_size le counter.
                exit.
              endif.
            else.
              close cursor g_cursor.
              s_flg_no_more_data = true.
              exit.
            endif.
          enddo.
        END-OF-DEFINITION.
    The call is as follow:
    sel 'MC13VD0ITM' mc13vd0itm_tab  mc13vd0itmsetup.

    Hi pooja,
    1. import &2 from database &3(bw) id id.
      IMPORT
      (See F1 Help )
    2. The macro line
       is importing
       from database cluster :
       internal table &2
       from cluster table &3
    3. where &2 &3 are the parameters
       passed to the macro while calling.
    regards,
    amit m.

  • Shape selection operation is not recorded when recording a macro

    Hi frinds
    in Word 2013, via "record macro" tools, i am writing a macro which performs the following tasks for me:
    1- when i select a word, it changes the font size & color & cuts the word
    2-inserts a quick part object called "MyRectangle" in the location of cut word ( i had created a customized rectangle shape & i had saved it as an Auto-text for later use)
    3- clicks on that Auto-text ( that Auto-text be selected)
    4- paste that word into Auto-text (Add the text inside that object)
    all above steps are done fine except step 3. the problem is when i start record macro, then it's not possible to select that rectangle shape ( i mean i left click on that rectangle but noting happens & it's not selected), so i can't paste that word into
    that shape.
    during record macro operation, can't we select shapes? if no, so what code i can write inside the macro for selection of that shape?
    thanks in advance

    Thanks Maurice for the sample above.
    John, for macro related issues, you can post in our MSDN forum of
    Word for Developers, where you can get more experienced responses:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Hi Erhan
    i wasn't familiar with this forum.
    thanks a lot
    best regards

  • Using a macro for a pivot table

    Hi guys,
    I have read the question above and the answers provided in this thread. However, I am still struggling to record a Macro template with a Pivot Table. I am using a Mac and Excel 2011. 
    My steps involve the following:
    1) I import a CSV file
    2) I format the cells (time of day into 12:00 am format)
    3) I create a simple pivot table (time of day and the total site visits)
    4)I group the time of day and colour code the total site visits
    Now, this is where I get confused. Usually, I delete all the information so my cells remain empty, but remain with working macros. With the pivot table, I have deleted the pivot table and left it in its original state but nothing has worked yet.
    I have tried importing new data into my Macro template (with a pivot table) but I keep receiving the 1004 error, so I need to debug the code. Now I have no knowledge of VBA but I when I hit "debug", it says I need to delete/change some code (as
    you have done in the thread above). However, i never deleted any sheets (as the user did above) so, I don't know where I am going wrong.
    Any help would be most welcome. Below is the code that is appearing on my erroneous macro:
    Sub Macro5()
    ' Macro5 Macro
        Range("A8").Select
        Selection.NumberFormat = "[$-F400]h:mm:ss AM/PM"
        Selection.AutoFill Destination:=Range("A8:A175")
        Range("A8:A175").Select
        Range("A7:B175").Select
        Sheets.Add
        ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
            "Test 1.csv!R7C1:R175C2", Version:=xlPivotTableVersion14).CreatePivotTable _
            TableDestination:="Sheet1!R3C1", TableName:="PivotTable4", DefaultVersion _
            :=xlPivotTableVersion14
        Sheets("Sheet1").Select
        Cells(3, 1).Select
        ActiveSheet.PivotTables("PivotTable4").AddDataField ActiveSheet.PivotTables( _
            "PivotTable4").PivotFields("Sessions"), "Sum of Sessions", xlSum
        Range("A5").Select
        Selection.Group Start:=True, End:=True, Periods:=Array(False, False, True, _
            False, False, False, False)
        Range("B5:B28").Select
        Selection.FormatConditions.AddColorScale ColorScaleType:=3
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        Selection.FormatConditions(1).ColorScaleCriteria(1).Type = _
            xlConditionValueLowestValue
        With Selection.FormatConditions(1).ColorScaleCriteria(1).FormatColor
            .Color = 7039480
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).ColorScaleCriteria(2).Type = _
            xlConditionValuePercentile
        Selection.FormatConditions(1).ColorScaleCriteria(2).Value = 50
        With Selection.FormatConditions(1).ColorScaleCriteria(2).FormatColor
            .Color = 8711167
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).ColorScaleCriteria(3).Type = _
            xlConditionValueHighestValue
        With Selection.FormatConditions(1).ColorScaleCriteria(3).FormatColor
            .Color = 8109667
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).ScopeType = xlSelectionScope
        Range("H14").Select
        Sheets("Test 1.csv").Select
        Sheets("Test 1.csv").Move Before:=Sheets(1)
        ActiveWindow.SmallScroll Down:=-598
        Range("A6").Select
    End Sub

    Hi,
    Base on my test in excel 2013, it works fine.
    You said your excel version is excel 2011, there isn’t that version of office.
    >> I keep receiving the 1004 error
    Does it has detail error message?
    >> it says I need to delete/change some code
    Could you provide the screenshot here?
    On the other hand, you may share a sample file on the OneDrive.
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Checkbox macros not working in Microsoft Word 2003

    Using Visual Basic Editor, I made an Employee Performance Review form that automatically calculates an employee's total score as check boxes are checked. Everything worked perfectly when I made it, but since saving and closing the program, the check boxes
    no longer work. They only show up as pictures - not as working check boxes that can be clicked. They don't even have a "properties" option. The document was saved as a "Word 2007 Macro-enabled Document" and the security settings on my computer
    are set to "Medium" so that Word asks me if I want to enable macros when the document is opened. Regardless of whether or not I click "enable" or "do not enable," the check boxes won't work. I made another quick document with
    check boxes to see if it had the same problem and it does as well. As soon as the document is saved, closed, and re-opened, the check boxes are deactivated. What am I doing wrong?

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, this issue is related to Word DEV, I recommend you post it question to the MSDN forum for Word
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=worddev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Excel 2007 Macros do not run even after applying known "fixit" steps

    Good day everyone,
    By now, a lot of you here are already aware of the issue that began following the December 9th security update.  I experienced this issue at our offices and used the known fixes for it, which solved the problem for most of my users.
    To clarify, this is the specific issue I'm referring to:
    http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2014/12/11/forms-controls-stop-working-after-december-2014-updates-.aspx
    However, I now have at least 5 users who are unable to use any macros.  When pressing the buttons, there is no reaction at all.  Windows Updates have been run, the relevant KB has been installed and I've run the fixit provided.  I even manually
    checked all of the relevant folders in order to make sure the .exd files have been wiped. 
    Yet when I try to run the macros, it still doesn't work.  Their Excel settings allow for macro execution.  In case, I tried setting it on the insecure option that allows everything and tried again, but without success.   I've also asked
    the person who coded the macros to recompile one of his spreadsheets after making a minor modification, as is mentioned in the support structure, but tests with that updated spreadsheet also failed.
    The issue seems machine-based as I am unable to run the macros myself if I use my login on that machine, however they work fine if I try doing so from my own computer.  This leads me to believe it could be a conflict caused by some other software installation
    and I'll look into this after I posted this message, but I'd be interested to hear any feedback you guys may have.
    Our users run Windows 7 Professional x64 and we have Office 2007 Professional Plus.
    Thanks in advance,

    Hi,
    We have definitely heard your frustration now, Microsoft understands the position our customers are in and we are actively working to find a solution besides a FixIt that can be deployed to remedy the issue. If we have any update, we'll post in this
    forum immediately.
    Thanks for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

Maybe you are looking for

  • How can I share my photos with family with text to ID the photo

    I have our families'  photos on CD/DVD/my Mac's but I would like to share them with the rest of the families by way of CD/DVD.  I'm also probably the only one in my family who could id the subjects in the photo's......how can I use text ON the photo

  • Terminal

    ok guys, I'm not new to macs but don't use terminal very much. Just got my new i7 and opened terminal. I entered ' smartctl -a /dev/sdX | grep LoadCycleCount ' hoping to find out how many cycles my hard drive has registered not knowing if the command

  • Final Cut With SSDs: experiences or opinions?

    Hi all, I'm looking to get a new MacBook Pro, and I'm swithering as to whether to go trad drive or solid state. I have (of course) read any number of opinions pro and con on any number of sites, and as such I am none the wiser. Is anyone using FCS on

  • Slow-Motion Examples

    Hi there. Does anyone know a place where I can find video examples of Motion 3's use of optical flow slow motion other than the FCS2 website? I'd also be curious to hear anyone's experience with slow motion on Motion 3. The example on the website loo

  • Is it possible to have 2 lines with BT Infinity Un...

    As you will know, BT Infinity Unlimited broadband has a 100GB threshold, which when met will then throttle your speed to about 1Mb download which renders your internet all but useless except for the most basic tasks. I use around 150GB in down/upload