+ Reply to Thread
Results 1 to 7 of 7

Macro to Copy & Paste in backgorund

  1. #1
    Alarmbloke
    Guest

    Macro to Copy & Paste in backgorund

    Hello again,

    I currently have a few macros which copy and paste data from one sheet to
    another.

    When the run you see the sheets flicking between each other as the macro
    selects the active sheet, copies the selected range, then selects the
    destination sheet pastes etc etc.

    This all works as it should but is there a way of doing it in the background
    whilst the user just sees the main input sheet and not flicking pages.

    This would seriously help with saving my eye sight

    Messy(Macro) as below

    Sub transfer()
    '
    ' transfer Macro
    '
    '

    '
    Range("H11").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B48:M48").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H12").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B50:M50").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H13").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B51:M51").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H14").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B52:M52").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H15").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B53:M53").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H16").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B54:M54").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H17").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B55:M55").Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    Range("H18").Select
    Selection.Copy
    Sheets("Quote").Select
    Range("B56").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    SkipBlanks _
    :=False, Transpose:=False
    Sheets("Quote").Select
    Range("N47:U47").Select

    End Sub


  2. #2
    Nigel
    Guest

    RE: Macro to Copy & Paste in backgorund

    hi,

    could you copy the range H12:H18 and paste it into your other cells on the
    Quote sheet in one job lot? are the cells on quote book B**:M** merged cells?

    regs,

    Nigel


    "Alarmbloke" wrote:

    > Hello again,
    >
    > I currently have a few macros which copy and paste data from one sheet to
    > another.
    >
    > When the run you see the sheets flicking between each other as the macro
    > selects the active sheet, copies the selected range, then selects the
    > destination sheet pastes etc etc.
    >
    > This all works as it should but is there a way of doing it in the background
    > whilst the user just sees the main input sheet and not flicking pages.
    >
    > This would seriously help with saving my eye sight
    >
    > Messy(Macro) as below
    >
    > Sub transfer()
    > '
    > ' transfer Macro
    > '
    > '
    >
    > '
    > Range("H11").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B48:M48").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H12").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B50:M50").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H13").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B51:M51").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H14").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B52:M52").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H15").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B53:M53").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H16").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B54:M54").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H17").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B55:M55").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H18").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B56").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Sheets("Quote").Select
    > Range("N47:U47").Select
    >
    > End Sub
    >


  3. #3
    Alarmbloke
    Guest

    RE: Macro to Copy & Paste in backgorund

    Hi,

    Yes B**:M** are merged cells

    Does that complicate matters??

    "Nigel" wrote:

    > hi,
    >
    > could you copy the range H12:H18 and paste it into your other cells on the
    > Quote sheet in one job lot? are the cells on quote book B**:M** merged cells?
    >
    > regs,
    >
    > Nigel
    >
    >
    > "Alarmbloke" wrote:
    >
    > > Hello again,
    > >
    > > I currently have a few macros which copy and paste data from one sheet to
    > > another.
    > >
    > > When the run you see the sheets flicking between each other as the macro
    > > selects the active sheet, copies the selected range, then selects the
    > > destination sheet pastes etc etc.
    > >
    > > This all works as it should but is there a way of doing it in the background
    > > whilst the user just sees the main input sheet and not flicking pages.
    > >
    > > This would seriously help with saving my eye sight
    > >
    > > Messy(Macro) as below
    > >
    > > Sub transfer()
    > > '
    > > ' transfer Macro
    > > '
    > > '
    > >
    > > '
    > > Range("H11").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B48:M48").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H12").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B50:M50").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H13").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B51:M51").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H14").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B52:M52").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H15").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B53:M53").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H16").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B54:M54").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H17").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B55:M55").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H18").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B56").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Sheets("Quote").Select
    > > Range("N47:U47").Select
    > >
    > > End Sub
    > >


  4. #4
    Alarmbloke
    Guest

    RE: Macro to Copy & Paste in backgorund

    Should also add that the data that is being copied doesnt stay the same all
    the time, this is to say I only need a snapshot of the data rather than using
    =Sheet1!H12 for example which I assume would alter the data automatically if
    it changes.
    Sorry to complicate matters

    "Alarmbloke" wrote:

    > Hello again,
    >
    > I currently have a few macros which copy and paste data from one sheet to
    > another.
    >
    > When the run you see the sheets flicking between each other as the macro
    > selects the active sheet, copies the selected range, then selects the
    > destination sheet pastes etc etc.
    >
    > This all works as it should but is there a way of doing it in the background
    > whilst the user just sees the main input sheet and not flicking pages.
    >
    > This would seriously help with saving my eye sight
    >
    > Messy(Macro) as below
    >
    > Sub transfer()
    > '
    > ' transfer Macro
    > '
    > '
    >
    > '
    > Range("H11").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B48:M48").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H12").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B50:M50").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H13").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B51:M51").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H14").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B52:M52").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H15").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B53:M53").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H16").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B54:M54").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H17").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B55:M55").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H18").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B56").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Sheets("Quote").Select
    > Range("N47:U47").Select
    >
    > End Sub
    >


  5. #5
    DS NTE
    Guest

    Re: Macro to Copy & Paste in backgorund

    To avoid flickering:

    Application.Screenupdating = False
    Your code
    Application.Screenupdating = True


    hth
    knut
    "Alarmbloke" <[email protected]> skrev i melding
    news:[email protected]...
    > Hello again,
    >
    > I currently have a few macros which copy and paste data from one sheet to
    > another.
    >
    > When the run you see the sheets flicking between each other as the macro
    > selects the active sheet, copies the selected range, then selects the
    > destination sheet pastes etc etc.
    >
    > This all works as it should but is there a way of doing it in the
    > background
    > whilst the user just sees the main input sheet and not flicking pages.
    >
    > This would seriously help with saving my eye sight
    >
    > Messy(Macro) as below
    >
    > Sub transfer()
    > '
    > ' transfer Macro
    > '
    > '
    >
    > '
    > Range("H11").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B48:M48").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H12").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B50:M50").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H13").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B51:M51").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H14").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B52:M52").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H15").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B53:M53").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H16").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B54:M54").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H17").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B55:M55").Select
    > ActiveSheet.Paste
    > Sheets("Sheet1").Select
    > Range("H18").Select
    > Selection.Copy
    > Sheets("Quote").Select
    > Range("B56").Select
    > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > SkipBlanks _
    > :=False, Transpose:=False
    > Sheets("Quote").Select
    > Range("N47:U47").Select
    >
    > End Sub
    >




  6. #6
    Alarmbloke
    Guest

    Re: Macro to Copy & Paste in backgorund

    Amazing !!!! My pulsating eyes thank you immensly, just what the option ordered



    "DS NTE" wrote:

    > To avoid flickering:
    >
    > Application.Screenupdating = False
    > Your code
    > Application.Screenupdating = True
    >
    >
    > hth
    > knut
    > "Alarmbloke" <[email protected]> skrev i melding
    > news:[email protected]...
    > > Hello again,
    > >
    > > I currently have a few macros which copy and paste data from one sheet to
    > > another.
    > >
    > > When the run you see the sheets flicking between each other as the macro
    > > selects the active sheet, copies the selected range, then selects the
    > > destination sheet pastes etc etc.
    > >
    > > This all works as it should but is there a way of doing it in the
    > > background
    > > whilst the user just sees the main input sheet and not flicking pages.
    > >
    > > This would seriously help with saving my eye sight
    > >
    > > Messy(Macro) as below
    > >
    > > Sub transfer()
    > > '
    > > ' transfer Macro
    > > '
    > > '
    > >
    > > '
    > > Range("H11").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B48:M48").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H12").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B50:M50").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H13").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B51:M51").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H14").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B52:M52").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H15").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B53:M53").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H16").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B54:M54").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H17").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B55:M55").Select
    > > ActiveSheet.Paste
    > > Sheets("Sheet1").Select
    > > Range("H18").Select
    > > Selection.Copy
    > > Sheets("Quote").Select
    > > Range("B56").Select
    > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > SkipBlanks _
    > > :=False, Transpose:=False
    > > Sheets("Quote").Select
    > > Range("N47:U47").Select
    > >
    > > End Sub
    > >

    >
    >
    >


  7. #7
    Nigel
    Guest

    Re: Macro to Copy & Paste in backgorund

    Hi,

    You could use this:

    Sub Transfer()
    Application.ScreenUpdating = False

    Sheets("Quote").Select

    Range("H11").Select
    Ranger1 = ActiveCell.Value
    Range("H12").Select
    Ranger2 = ActiveCell.Value
    Range("H13").Select
    Ranger3 = ActiveCell.Value
    Range("H14").Select
    Ranger4 = ActiveCell.Value
    Range("H15").Select
    Ranger5 = ActiveCell.Value
    Range("H16").Select
    Ranger6 = ActiveCell.Value
    Range("H17").Select
    Ranger7 = ActiveCell.Value
    Range("H18").Select
    Ranger8 = ActiveCell.Value

    Range("Sheet1!B48").Value = Ranger1
    Range("Sheet1!B50").Value = Ranger2
    Range("Sheet1!B51").Value = Ranger3
    Range("Sheet1!B52").Value = Ranger4
    Range("Sheet1!B53").Value = Ranger5
    Range("Sheet1!B54").Value = Ranger6
    Range("Sheet1!B55").Value = Ranger7
    Range("Sheet1!B56").Value = Ranger8

    Sheets("Quote").Select
    Range("N47:U47").Select

    Application.ScreenUpdating = True

    End Sub

    This nests all of the required information from "Quote" and places it into
    "Sheet1".
    there is no need for pastespecials as it is placing the data Value only and
    not a path.

    the screen does not change so the info is transfers quickly in the
    background in 1 movement rather than 9.

    Hope it helps.

    Nigel



    "Alarmbloke" wrote:

    > Amazing !!!! My pulsating eyes thank you immensly, just what the option ordered
    >
    >
    >
    > "DS NTE" wrote:
    >
    > > To avoid flickering:
    > >
    > > Application.Screenupdating = False
    > > Your code
    > > Application.Screenupdating = True
    > >
    > >
    > > hth
    > > knut
    > > "Alarmbloke" <[email protected]> skrev i melding
    > > news:[email protected]...
    > > > Hello again,
    > > >
    > > > I currently have a few macros which copy and paste data from one sheet to
    > > > another.
    > > >
    > > > When the run you see the sheets flicking between each other as the macro
    > > > selects the active sheet, copies the selected range, then selects the
    > > > destination sheet pastes etc etc.
    > > >
    > > > This all works as it should but is there a way of doing it in the
    > > > background
    > > > whilst the user just sees the main input sheet and not flicking pages.
    > > >
    > > > This would seriously help with saving my eye sight
    > > >
    > > > Messy(Macro) as below
    > > >
    > > > Sub transfer()
    > > > '
    > > > ' transfer Macro
    > > > '
    > > > '
    > > >
    > > > '
    > > > Range("H11").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B48:M48").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H12").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B50:M50").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H13").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B51:M51").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H14").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B52:M52").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H15").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B53:M53").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H16").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B54:M54").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H17").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B55:M55").Select
    > > > ActiveSheet.Paste
    > > > Sheets("Sheet1").Select
    > > > Range("H18").Select
    > > > Selection.Copy
    > > > Sheets("Quote").Select
    > > > Range("B56").Select
    > > > Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
    > > > SkipBlanks _
    > > > :=False, Transpose:=False
    > > > Sheets("Quote").Select
    > > > Range("N47:U47").Select
    > > >
    > > > End Sub
    > > >

    > >
    > >
    > >


+ 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