+ Reply to Thread
Results 1 to 7 of 7

Macro works differently on different computers, same version of Ex

  1. #1
    oscardwilde
    Guest

    Macro works differently on different computers, same version of Ex

    I have created macros that automate a fairly simple process on several
    spreadsheets. There are three columns that are affected by the macro. One
    column is total of all previous month's expenses for a project, the next is
    the current month's expenses and the last column is total expenses to date.
    The macro simply copies the values from the total expenses to the previous
    month's column and zeros the current month so that it is ready for the next
    month's expenses. The macros work great on my computer but do not always
    perform the same way on other computers. Some fields it skips, others it
    does not. The formatting and number of cells in each column are the same and
    do not change. I've checked the security settings and the versions of Excel
    are the same so why doesn't it do the same thing on two different computers
    that use everything else the same?

    Here's the code:

    Sub ZeroDraw()
    '
    ' ZeroDraw Macro
    ' Macro recorded 8/26/2005 by Oscar
    '
    ' Keyboard Shortcut: Ctrl+d
    '
    Range("G7:G57").Select
    Selection.Copy
    ActiveWindow.ScrollRow = 27
    ActiveWindow.ScrollRow = 26
    ActiveWindow.ScrollRow = 25
    ActiveWindow.ScrollRow = 24
    ActiveWindow.ScrollRow = 23
    ActiveWindow.ScrollRow = 21
    ActiveWindow.ScrollRow = 20
    ActiveWindow.ScrollRow = 18
    ActiveWindow.ScrollRow = 16
    ActiveWindow.ScrollRow = 15
    ActiveWindow.ScrollRow = 14
    ActiveWindow.ScrollRow = 12
    ActiveWindow.ScrollRow = 11
    ActiveWindow.ScrollRow = 9
    ActiveWindow.ScrollRow = 7
    ActiveWindow.ScrollRow = 5
    ActiveWindow.ScrollRow = 4
    ActiveWindow.ScrollRow = 3
    ActiveWindow.ScrollRow = 2
    ActiveWindow.ScrollRow = 1
    Range("D7:D57").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks _
    :=False, Transpose:=False
    Range("E7").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "0"
    Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    Range("E7:E56").Select
    ActiveWindow.ScrollRow = 21
    ActiveWindow.ScrollRow = 20
    ActiveWindow.ScrollRow = 18
    ActiveWindow.ScrollRow = 16
    ActiveWindow.ScrollRow = 14
    ActiveWindow.ScrollRow = 13
    ActiveWindow.ScrollRow = 11
    ActiveWindow.ScrollRow = 8
    ActiveWindow.ScrollRow = 4
    ActiveWindow.ScrollRow = 1
    Range("K5").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    Range("K5").Select
    Selection.Copy
    Range("K6").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks _
    :=False, Transpose:=False
    Range("K5").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("K6").Select
    Selection.Cut
    Range("C4").Select
    ActiveSheet.Paste
    With Selection
    .HorizontalAlignment = xlLeft
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Range("B1").Select
    End Sub


  2. #2
    Don Guillett
    Guest

    Re: Macro works differently on different computers, same version of Ex

    Nothing is jumping out at me cuz of all the trash. To get you started.
    ALL of this code can be changed from
    =======
    > Range("G7:G57").Select
    > Selection.Copy
    > ActiveWindow.ScrollRow = 27
    > ActiveWindow.ScrollRow = 26
    > ActiveWindow.ScrollRow = 25
    > ActiveWindow.ScrollRow = 24
    > ActiveWindow.ScrollRow = 23
    > ActiveWindow.ScrollRow = 21
    > ActiveWindow.ScrollRow = 20
    > ActiveWindow.ScrollRow = 18
    > ActiveWindow.ScrollRow = 16
    > ActiveWindow.ScrollRow = 15
    > ActiveWindow.ScrollRow = 14
    > ActiveWindow.ScrollRow = 12
    > ActiveWindow.ScrollRow = 11
    > ActiveWindow.ScrollRow = 9
    > ActiveWindow.ScrollRow = 7
    > ActiveWindow.ScrollRow = 5
    > ActiveWindow.ScrollRow = 4
    > ActiveWindow.ScrollRow = 3
    > ActiveWindow.ScrollRow = 2
    > ActiveWindow.ScrollRow = 1
    > Range("D7:D57").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("E7").Select
    > Application.CutCopyMode = False

    =======
    to
    Range("D7:D57").value= Range("G7:G57").value
    also
    range("k6").value=range("k5")
    works
    etc.etc

    Don Guillett
    SalesAid Software
    [email protected]
    "oscardwilde" <[email protected]> wrote in message
    news:[email protected]...
    >I have created macros that automate a fairly simple process on several
    > spreadsheets. There are three columns that are affected by the macro.
    > One
    > column is total of all previous month's expenses for a project, the next
    > is
    > the current month's expenses and the last column is total expenses to
    > date.
    > The macro simply copies the values from the total expenses to the previous
    > month's column and zeros the current month so that it is ready for the
    > next
    > month's expenses. The macros work great on my computer but do not always
    > perform the same way on other computers. Some fields it skips, others it
    > does not. The formatting and number of cells in each column are the same
    > and
    > do not change. I've checked the security settings and the versions of
    > Excel
    > are the same so why doesn't it do the same thing on two different
    > computers
    > that use everything else the same?
    >
    > Here's the code:
    >
    > Sub ZeroDraw()
    > '
    > ' ZeroDraw Macro
    > ' Macro recorded 8/26/2005 by Oscar
    > '
    > ' Keyboard Shortcut: Ctrl+d
    > '
    > Range("G7:G57").Select
    > Selection.Copy
    > ActiveWindow.ScrollRow = 27
    > ActiveWindow.ScrollRow = 26
    > ActiveWindow.ScrollRow = 25
    > ActiveWindow.ScrollRow = 24
    > ActiveWindow.ScrollRow = 23
    > ActiveWindow.ScrollRow = 21
    > ActiveWindow.ScrollRow = 20
    > ActiveWindow.ScrollRow = 18
    > ActiveWindow.ScrollRow = 16
    > ActiveWindow.ScrollRow = 15
    > ActiveWindow.ScrollRow = 14
    > ActiveWindow.ScrollRow = 12
    > ActiveWindow.ScrollRow = 11
    > ActiveWindow.ScrollRow = 9
    > ActiveWindow.ScrollRow = 7
    > ActiveWindow.ScrollRow = 5
    > ActiveWindow.ScrollRow = 4
    > ActiveWindow.ScrollRow = 3
    > ActiveWindow.ScrollRow = 2
    > ActiveWindow.ScrollRow = 1
    > Range("D7:D57").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("E7").Select
    > Application.CutCopyMode = False
    > ActiveCell.FormulaR1C1 = "0"
    > Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    > Range("E7:E56").Select
    > ActiveWindow.ScrollRow = 21
    > ActiveWindow.ScrollRow = 20
    > ActiveWindow.ScrollRow = 18
    > ActiveWindow.ScrollRow = 16
    > ActiveWindow.ScrollRow = 14
    > ActiveWindow.ScrollRow = 13
    > ActiveWindow.ScrollRow = 11
    > ActiveWindow.ScrollRow = 8
    > ActiveWindow.ScrollRow = 4
    > ActiveWindow.ScrollRow = 1
    > Range("K5").Select
    > ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    > Range("K5").Select
    > Selection.Copy
    > Range("K6").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("K5").Select
    > Application.CutCopyMode = False
    > Selection.ClearContents
    > Range("K6").Select
    > Selection.Cut
    > Range("C4").Select
    > ActiveSheet.Paste
    > With Selection
    > .HorizontalAlignment = xlLeft
    > .VerticalAlignment = xlBottom
    > .WrapText = False
    > .Orientation = 0
    > .AddIndent = False
    > .IndentLevel = 0
    > .ShrinkToFit = False
    > .ReadingOrder = xlContext
    > .MergeCells = False
    > End With
    > Range("B1").Select
    > End Sub
    >




  3. #3
    Duke Carey
    Guest

    RE: Macro works differently on different computers, same version of Ex

    Try this revised version ON A COPY OF YOUR SPREADSHEET and see what happens

    Sub ZeroDraw()
    '
    ' ZeroDraw Macro
    ' Macro recorded 8/26/2005 by Oscar
    '
    ' Keyboard Shortcut: Ctrl+d
    '
    Range("G7:G57").Copy

    Range("D7:D57").PasteSpecial Paste:=xlPasteValues

    Range("E7:E56") = 0

    Range("C4") = Range("C4") + 1

    Range("B1").Select
    End Sub

    "oscardwilde" wrote:

    > I have created macros that automate a fairly simple process on several
    > spreadsheets. There are three columns that are affected by the macro. One
    > column is total of all previous month's expenses for a project, the next is
    > the current month's expenses and the last column is total expenses to date.
    > The macro simply copies the values from the total expenses to the previous
    > month's column and zeros the current month so that it is ready for the next
    > month's expenses. The macros work great on my computer but do not always
    > perform the same way on other computers. Some fields it skips, others it
    > does not. The formatting and number of cells in each column are the same and
    > do not change. I've checked the security settings and the versions of Excel
    > are the same so why doesn't it do the same thing on two different computers
    > that use everything else the same?
    >
    > Here's the code:
    >
    > Sub ZeroDraw()
    > '
    > ' ZeroDraw Macro
    > ' Macro recorded 8/26/2005 by Oscar
    > '
    > ' Keyboard Shortcut: Ctrl+d
    > '
    > Range("G7:G57").Select
    > Selection.Copy
    > ActiveWindow.ScrollRow = 27
    > ActiveWindow.ScrollRow = 26
    > ActiveWindow.ScrollRow = 25
    > ActiveWindow.ScrollRow = 24
    > ActiveWindow.ScrollRow = 23
    > ActiveWindow.ScrollRow = 21
    > ActiveWindow.ScrollRow = 20
    > ActiveWindow.ScrollRow = 18
    > ActiveWindow.ScrollRow = 16
    > ActiveWindow.ScrollRow = 15
    > ActiveWindow.ScrollRow = 14
    > ActiveWindow.ScrollRow = 12
    > ActiveWindow.ScrollRow = 11
    > ActiveWindow.ScrollRow = 9
    > ActiveWindow.ScrollRow = 7
    > ActiveWindow.ScrollRow = 5
    > ActiveWindow.ScrollRow = 4
    > ActiveWindow.ScrollRow = 3
    > ActiveWindow.ScrollRow = 2
    > ActiveWindow.ScrollRow = 1
    > Range("D7:D57").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("E7").Select
    > Application.CutCopyMode = False
    > ActiveCell.FormulaR1C1 = "0"
    > Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    > Range("E7:E56").Select
    > ActiveWindow.ScrollRow = 21
    > ActiveWindow.ScrollRow = 20
    > ActiveWindow.ScrollRow = 18
    > ActiveWindow.ScrollRow = 16
    > ActiveWindow.ScrollRow = 14
    > ActiveWindow.ScrollRow = 13
    > ActiveWindow.ScrollRow = 11
    > ActiveWindow.ScrollRow = 8
    > ActiveWindow.ScrollRow = 4
    > ActiveWindow.ScrollRow = 1
    > Range("K5").Select
    > ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    > Range("K5").Select
    > Selection.Copy
    > Range("K6").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Range("K5").Select
    > Application.CutCopyMode = False
    > Selection.ClearContents
    > Range("K6").Select
    > Selection.Cut
    > Range("C4").Select
    > ActiveSheet.Paste
    > With Selection
    > .HorizontalAlignment = xlLeft
    > .VerticalAlignment = xlBottom
    > .WrapText = False
    > .Orientation = 0
    > .AddIndent = False
    > .IndentLevel = 0
    > .ShrinkToFit = False
    > .ReadingOrder = xlContext
    > .MergeCells = False
    > End With
    > Range("B1").Select
    > End Sub
    >


  4. #4
    oscardwilde
    Guest

    RE: Macro works differently on different computers, same version o

    Perfect! Thank you. It worked flawlessly. Tried it on several computers
    and no problem. The only thing that it does that isn't a big deal is it
    leaves one column selected (with the flashing selection around it). Is there
    a command I can put in there to stop that so that it doesn't confuse my users?


    "Duke Carey" wrote:

    > Try this revised version ON A COPY OF YOUR SPREADSHEET and see what happens
    >
    > Sub ZeroDraw()
    > '
    > ' ZeroDraw Macro
    > ' Macro recorded 8/26/2005 by Oscar
    > '
    > ' Keyboard Shortcut: Ctrl+d
    > '
    > Range("G7:G57").Copy
    >
    > Range("D7:D57").PasteSpecial Paste:=xlPasteValues
    >
    > Range("E7:E56") = 0
    >
    > Range("C4") = Range("C4") + 1
    >
    > Range("B1").Select
    > End Sub
    >
    > "oscardwilde" wrote:
    >
    > > I have created macros that automate a fairly simple process on several
    > > spreadsheets. There are three columns that are affected by the macro. One
    > > column is total of all previous month's expenses for a project, the next is
    > > the current month's expenses and the last column is total expenses to date.
    > > The macro simply copies the values from the total expenses to the previous
    > > month's column and zeros the current month so that it is ready for the next
    > > month's expenses. The macros work great on my computer but do not always
    > > perform the same way on other computers. Some fields it skips, others it
    > > does not. The formatting and number of cells in each column are the same and
    > > do not change. I've checked the security settings and the versions of Excel
    > > are the same so why doesn't it do the same thing on two different computers
    > > that use everything else the same?
    > >
    > > Here's the code:
    > >
    > > Sub ZeroDraw()
    > > '
    > > ' ZeroDraw Macro
    > > ' Macro recorded 8/26/2005 by Oscar
    > > '
    > > ' Keyboard Shortcut: Ctrl+d
    > > '
    > > Range("G7:G57").Select
    > > Selection.Copy
    > > ActiveWindow.ScrollRow = 27
    > > ActiveWindow.ScrollRow = 26
    > > ActiveWindow.ScrollRow = 25
    > > ActiveWindow.ScrollRow = 24
    > > ActiveWindow.ScrollRow = 23
    > > ActiveWindow.ScrollRow = 21
    > > ActiveWindow.ScrollRow = 20
    > > ActiveWindow.ScrollRow = 18
    > > ActiveWindow.ScrollRow = 16
    > > ActiveWindow.ScrollRow = 15
    > > ActiveWindow.ScrollRow = 14
    > > ActiveWindow.ScrollRow = 12
    > > ActiveWindow.ScrollRow = 11
    > > ActiveWindow.ScrollRow = 9
    > > ActiveWindow.ScrollRow = 7
    > > ActiveWindow.ScrollRow = 5
    > > ActiveWindow.ScrollRow = 4
    > > ActiveWindow.ScrollRow = 3
    > > ActiveWindow.ScrollRow = 2
    > > ActiveWindow.ScrollRow = 1
    > > Range("D7:D57").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Range("E7").Select
    > > Application.CutCopyMode = False
    > > ActiveCell.FormulaR1C1 = "0"
    > > Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    > > Range("E7:E56").Select
    > > ActiveWindow.ScrollRow = 21
    > > ActiveWindow.ScrollRow = 20
    > > ActiveWindow.ScrollRow = 18
    > > ActiveWindow.ScrollRow = 16
    > > ActiveWindow.ScrollRow = 14
    > > ActiveWindow.ScrollRow = 13
    > > ActiveWindow.ScrollRow = 11
    > > ActiveWindow.ScrollRow = 8
    > > ActiveWindow.ScrollRow = 4
    > > ActiveWindow.ScrollRow = 1
    > > Range("K5").Select
    > > ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    > > Range("K5").Select
    > > Selection.Copy
    > > Range("K6").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Range("K5").Select
    > > Application.CutCopyMode = False
    > > Selection.ClearContents
    > > Range("K6").Select
    > > Selection.Cut
    > > Range("C4").Select
    > > ActiveSheet.Paste
    > > With Selection
    > > .HorizontalAlignment = xlLeft
    > > .VerticalAlignment = xlBottom
    > > .WrapText = False
    > > .Orientation = 0
    > > .AddIndent = False
    > > .IndentLevel = 0
    > > .ShrinkToFit = False
    > > .ReadingOrder = xlContext
    > > .MergeCells = False
    > > End With
    > > Range("B1").Select
    > > End Sub
    > >


  5. #5
    oscardwilde
    Guest

    Re: Macro works differently on different computers, same version o

    Thank you. I see that now. I made the macro just by recording my actions.
    Didn't even think about simplifying as you did. Thanks.

    "Don Guillett" wrote:

    > Nothing is jumping out at me cuz of all the trash. To get you started.
    > ALL of this code can be changed from
    > =======
    > > Range("G7:G57").Select
    > > Selection.Copy
    > > ActiveWindow.ScrollRow = 27
    > > ActiveWindow.ScrollRow = 26
    > > ActiveWindow.ScrollRow = 25
    > > ActiveWindow.ScrollRow = 24
    > > ActiveWindow.ScrollRow = 23
    > > ActiveWindow.ScrollRow = 21
    > > ActiveWindow.ScrollRow = 20
    > > ActiveWindow.ScrollRow = 18
    > > ActiveWindow.ScrollRow = 16
    > > ActiveWindow.ScrollRow = 15
    > > ActiveWindow.ScrollRow = 14
    > > ActiveWindow.ScrollRow = 12
    > > ActiveWindow.ScrollRow = 11
    > > ActiveWindow.ScrollRow = 9
    > > ActiveWindow.ScrollRow = 7
    > > ActiveWindow.ScrollRow = 5
    > > ActiveWindow.ScrollRow = 4
    > > ActiveWindow.ScrollRow = 3
    > > ActiveWindow.ScrollRow = 2
    > > ActiveWindow.ScrollRow = 1
    > > Range("D7:D57").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Range("E7").Select
    > > Application.CutCopyMode = False

    > =======
    > to
    > Range("D7:D57").value= Range("G7:G57").value
    > also
    > range("k6").value=range("k5")
    > works
    > etc.etc
    >
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "oscardwilde" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have created macros that automate a fairly simple process on several
    > > spreadsheets. There are three columns that are affected by the macro.
    > > One
    > > column is total of all previous month's expenses for a project, the next
    > > is
    > > the current month's expenses and the last column is total expenses to
    > > date.
    > > The macro simply copies the values from the total expenses to the previous
    > > month's column and zeros the current month so that it is ready for the
    > > next
    > > month's expenses. The macros work great on my computer but do not always
    > > perform the same way on other computers. Some fields it skips, others it
    > > does not. The formatting and number of cells in each column are the same
    > > and
    > > do not change. I've checked the security settings and the versions of
    > > Excel
    > > are the same so why doesn't it do the same thing on two different
    > > computers
    > > that use everything else the same?
    > >
    > > Here's the code:
    > >
    > > Sub ZeroDraw()
    > > '
    > > ' ZeroDraw Macro
    > > ' Macro recorded 8/26/2005 by Oscar
    > > '
    > > ' Keyboard Shortcut: Ctrl+d
    > > '
    > > Range("G7:G57").Select
    > > Selection.Copy
    > > ActiveWindow.ScrollRow = 27
    > > ActiveWindow.ScrollRow = 26
    > > ActiveWindow.ScrollRow = 25
    > > ActiveWindow.ScrollRow = 24
    > > ActiveWindow.ScrollRow = 23
    > > ActiveWindow.ScrollRow = 21
    > > ActiveWindow.ScrollRow = 20
    > > ActiveWindow.ScrollRow = 18
    > > ActiveWindow.ScrollRow = 16
    > > ActiveWindow.ScrollRow = 15
    > > ActiveWindow.ScrollRow = 14
    > > ActiveWindow.ScrollRow = 12
    > > ActiveWindow.ScrollRow = 11
    > > ActiveWindow.ScrollRow = 9
    > > ActiveWindow.ScrollRow = 7
    > > ActiveWindow.ScrollRow = 5
    > > ActiveWindow.ScrollRow = 4
    > > ActiveWindow.ScrollRow = 3
    > > ActiveWindow.ScrollRow = 2
    > > ActiveWindow.ScrollRow = 1
    > > Range("D7:D57").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Range("E7").Select
    > > Application.CutCopyMode = False
    > > ActiveCell.FormulaR1C1 = "0"
    > > Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    > > Range("E7:E56").Select
    > > ActiveWindow.ScrollRow = 21
    > > ActiveWindow.ScrollRow = 20
    > > ActiveWindow.ScrollRow = 18
    > > ActiveWindow.ScrollRow = 16
    > > ActiveWindow.ScrollRow = 14
    > > ActiveWindow.ScrollRow = 13
    > > ActiveWindow.ScrollRow = 11
    > > ActiveWindow.ScrollRow = 8
    > > ActiveWindow.ScrollRow = 4
    > > ActiveWindow.ScrollRow = 1
    > > Range("K5").Select
    > > ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    > > Range("K5").Select
    > > Selection.Copy
    > > Range("K6").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Range("K5").Select
    > > Application.CutCopyMode = False
    > > Selection.ClearContents
    > > Range("K6").Select
    > > Selection.Cut
    > > Range("C4").Select
    > > ActiveSheet.Paste
    > > With Selection
    > > .HorizontalAlignment = xlLeft
    > > .VerticalAlignment = xlBottom
    > > .WrapText = False
    > > .Orientation = 0
    > > .AddIndent = False
    > > .IndentLevel = 0
    > > .ShrinkToFit = False
    > > .ReadingOrder = xlContext
    > > .MergeCells = False
    > > End With
    > > Range("B1").Select
    > > End Sub
    > >

    >
    >
    >


  6. #6
    Dave Peterson
    Guest

    Re: Macro works differently on different computers, same version o

    application.cutcopymode = false

    will remove the "marching ants" around the selection.





    oscardwilde wrote:
    >
    > Perfect! Thank you. It worked flawlessly. Tried it on several computers
    > and no problem. The only thing that it does that isn't a big deal is it
    > leaves one column selected (with the flashing selection around it). Is there
    > a command I can put in there to stop that so that it doesn't confuse my users?
    >
    > "Duke Carey" wrote:
    >
    > > Try this revised version ON A COPY OF YOUR SPREADSHEET and see what happens
    > >
    > > Sub ZeroDraw()
    > > '
    > > ' ZeroDraw Macro
    > > ' Macro recorded 8/26/2005 by Oscar
    > > '
    > > ' Keyboard Shortcut: Ctrl+d
    > > '
    > > Range("G7:G57").Copy
    > >
    > > Range("D7:D57").PasteSpecial Paste:=xlPasteValues
    > >
    > > Range("E7:E56") = 0
    > >
    > > Range("C4") = Range("C4") + 1
    > >
    > > Range("B1").Select
    > > End Sub
    > >
    > > "oscardwilde" wrote:
    > >
    > > > I have created macros that automate a fairly simple process on several
    > > > spreadsheets. There are three columns that are affected by the macro. One
    > > > column is total of all previous month's expenses for a project, the next is
    > > > the current month's expenses and the last column is total expenses to date.
    > > > The macro simply copies the values from the total expenses to the previous
    > > > month's column and zeros the current month so that it is ready for the next
    > > > month's expenses. The macros work great on my computer but do not always
    > > > perform the same way on other computers. Some fields it skips, others it
    > > > does not. The formatting and number of cells in each column are the same and
    > > > do not change. I've checked the security settings and the versions of Excel
    > > > are the same so why doesn't it do the same thing on two different computers
    > > > that use everything else the same?
    > > >
    > > > Here's the code:
    > > >
    > > > Sub ZeroDraw()
    > > > '
    > > > ' ZeroDraw Macro
    > > > ' Macro recorded 8/26/2005 by Oscar
    > > > '
    > > > ' Keyboard Shortcut: Ctrl+d
    > > > '
    > > > Range("G7:G57").Select
    > > > Selection.Copy
    > > > ActiveWindow.ScrollRow = 27
    > > > ActiveWindow.ScrollRow = 26
    > > > ActiveWindow.ScrollRow = 25
    > > > ActiveWindow.ScrollRow = 24
    > > > ActiveWindow.ScrollRow = 23
    > > > ActiveWindow.ScrollRow = 21
    > > > ActiveWindow.ScrollRow = 20
    > > > ActiveWindow.ScrollRow = 18
    > > > ActiveWindow.ScrollRow = 16
    > > > ActiveWindow.ScrollRow = 15
    > > > ActiveWindow.ScrollRow = 14
    > > > ActiveWindow.ScrollRow = 12
    > > > ActiveWindow.ScrollRow = 11
    > > > ActiveWindow.ScrollRow = 9
    > > > ActiveWindow.ScrollRow = 7
    > > > ActiveWindow.ScrollRow = 5
    > > > ActiveWindow.ScrollRow = 4
    > > > ActiveWindow.ScrollRow = 3
    > > > ActiveWindow.ScrollRow = 2
    > > > ActiveWindow.ScrollRow = 1
    > > > Range("D7:D57").Select
    > > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > > SkipBlanks _
    > > > :=False, Transpose:=False
    > > > Range("E7").Select
    > > > Application.CutCopyMode = False
    > > > ActiveCell.FormulaR1C1 = "0"
    > > > Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    > > > Range("E7:E56").Select
    > > > ActiveWindow.ScrollRow = 21
    > > > ActiveWindow.ScrollRow = 20
    > > > ActiveWindow.ScrollRow = 18
    > > > ActiveWindow.ScrollRow = 16
    > > > ActiveWindow.ScrollRow = 14
    > > > ActiveWindow.ScrollRow = 13
    > > > ActiveWindow.ScrollRow = 11
    > > > ActiveWindow.ScrollRow = 8
    > > > ActiveWindow.ScrollRow = 4
    > > > ActiveWindow.ScrollRow = 1
    > > > Range("K5").Select
    > > > ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    > > > Range("K5").Select
    > > > Selection.Copy
    > > > Range("K6").Select
    > > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > > SkipBlanks _
    > > > :=False, Transpose:=False
    > > > Range("K5").Select
    > > > Application.CutCopyMode = False
    > > > Selection.ClearContents
    > > > Range("K6").Select
    > > > Selection.Cut
    > > > Range("C4").Select
    > > > ActiveSheet.Paste
    > > > With Selection
    > > > .HorizontalAlignment = xlLeft
    > > > .VerticalAlignment = xlBottom
    > > > .WrapText = False
    > > > .Orientation = 0
    > > > .AddIndent = False
    > > > .IndentLevel = 0
    > > > .ShrinkToFit = False
    > > > .ReadingOrder = xlContext
    > > > .MergeCells = False
    > > > End With
    > > > Range("B1").Select
    > > > End Sub
    > > >


    --

    Dave Peterson

  7. #7
    oscardwilde
    Guest

    Re: Macro works differently on different computers, same version o

    Thank you. That was perfect. Greatly appreciated.

    "Dave Peterson" wrote:

    > application.cutcopymode = false
    >
    > will remove the "marching ants" around the selection.
    >
    >
    >
    >
    >
    > oscardwilde wrote:
    > >
    > > Perfect! Thank you. It worked flawlessly. Tried it on several computers
    > > and no problem. The only thing that it does that isn't a big deal is it
    > > leaves one column selected (with the flashing selection around it). Is there
    > > a command I can put in there to stop that so that it doesn't confuse my users?
    > >
    > > "Duke Carey" wrote:
    > >
    > > > Try this revised version ON A COPY OF YOUR SPREADSHEET and see what happens
    > > >
    > > > Sub ZeroDraw()
    > > > '
    > > > ' ZeroDraw Macro
    > > > ' Macro recorded 8/26/2005 by Oscar
    > > > '
    > > > ' Keyboard Shortcut: Ctrl+d
    > > > '
    > > > Range("G7:G57").Copy
    > > >
    > > > Range("D7:D57").PasteSpecial Paste:=xlPasteValues
    > > >
    > > > Range("E7:E56") = 0
    > > >
    > > > Range("C4") = Range("C4") + 1
    > > >
    > > > Range("B1").Select
    > > > End Sub
    > > >
    > > > "oscardwilde" wrote:
    > > >
    > > > > I have created macros that automate a fairly simple process on several
    > > > > spreadsheets. There are three columns that are affected by the macro. One
    > > > > column is total of all previous month's expenses for a project, the next is
    > > > > the current month's expenses and the last column is total expenses to date.
    > > > > The macro simply copies the values from the total expenses to the previous
    > > > > month's column and zeros the current month so that it is ready for the next
    > > > > month's expenses. The macros work great on my computer but do not always
    > > > > perform the same way on other computers. Some fields it skips, others it
    > > > > does not. The formatting and number of cells in each column are the same and
    > > > > do not change. I've checked the security settings and the versions of Excel
    > > > > are the same so why doesn't it do the same thing on two different computers
    > > > > that use everything else the same?
    > > > >
    > > > > Here's the code:
    > > > >
    > > > > Sub ZeroDraw()
    > > > > '
    > > > > ' ZeroDraw Macro
    > > > > ' Macro recorded 8/26/2005 by Oscar
    > > > > '
    > > > > ' Keyboard Shortcut: Ctrl+d
    > > > > '
    > > > > Range("G7:G57").Select
    > > > > Selection.Copy
    > > > > ActiveWindow.ScrollRow = 27
    > > > > ActiveWindow.ScrollRow = 26
    > > > > ActiveWindow.ScrollRow = 25
    > > > > ActiveWindow.ScrollRow = 24
    > > > > ActiveWindow.ScrollRow = 23
    > > > > ActiveWindow.ScrollRow = 21
    > > > > ActiveWindow.ScrollRow = 20
    > > > > ActiveWindow.ScrollRow = 18
    > > > > ActiveWindow.ScrollRow = 16
    > > > > ActiveWindow.ScrollRow = 15
    > > > > ActiveWindow.ScrollRow = 14
    > > > > ActiveWindow.ScrollRow = 12
    > > > > ActiveWindow.ScrollRow = 11
    > > > > ActiveWindow.ScrollRow = 9
    > > > > ActiveWindow.ScrollRow = 7
    > > > > ActiveWindow.ScrollRow = 5
    > > > > ActiveWindow.ScrollRow = 4
    > > > > ActiveWindow.ScrollRow = 3
    > > > > ActiveWindow.ScrollRow = 2
    > > > > ActiveWindow.ScrollRow = 1
    > > > > Range("D7:D57").Select
    > > > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > > > SkipBlanks _
    > > > > :=False, Transpose:=False
    > > > > Range("E7").Select
    > > > > Application.CutCopyMode = False
    > > > > ActiveCell.FormulaR1C1 = "0"
    > > > > Selection.AutoFill Destination:=Range("E7:E56"), Type:=xlFillDefault
    > > > > Range("E7:E56").Select
    > > > > ActiveWindow.ScrollRow = 21
    > > > > ActiveWindow.ScrollRow = 20
    > > > > ActiveWindow.ScrollRow = 18
    > > > > ActiveWindow.ScrollRow = 16
    > > > > ActiveWindow.ScrollRow = 14
    > > > > ActiveWindow.ScrollRow = 13
    > > > > ActiveWindow.ScrollRow = 11
    > > > > ActiveWindow.ScrollRow = 8
    > > > > ActiveWindow.ScrollRow = 4
    > > > > ActiveWindow.ScrollRow = 1
    > > > > Range("K5").Select
    > > > > ActiveCell.FormulaR1C1 = "=SUM(R[-1]C[-8]+1)"
    > > > > Range("K5").Select
    > > > > Selection.Copy
    > > > > Range("K6").Select
    > > > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > > > SkipBlanks _
    > > > > :=False, Transpose:=False
    > > > > Range("K5").Select
    > > > > Application.CutCopyMode = False
    > > > > Selection.ClearContents
    > > > > Range("K6").Select
    > > > > Selection.Cut
    > > > > Range("C4").Select
    > > > > ActiveSheet.Paste
    > > > > With Selection
    > > > > .HorizontalAlignment = xlLeft
    > > > > .VerticalAlignment = xlBottom
    > > > > .WrapText = False
    > > > > .Orientation = 0
    > > > > .AddIndent = False
    > > > > .IndentLevel = 0
    > > > > .ShrinkToFit = False
    > > > > .ReadingOrder = xlContext
    > > > > .MergeCells = False
    > > > > End With
    > > > > Range("B1").Select
    > > > > End Sub
    > > > >

    >
    > --
    >
    > Dave Peterson
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1