Consulting

Results 1 to 4 of 4

Thread: Paste as Value

  1. #1
    VBAX Regular
    Joined
    Nov 2008
    Posts
    41
    Location

    Paste as Value

    Hi,

    I'd like to move some columns and use paste as value. Can I do this with vba?

    Thanks in advance,

    Wannes

    [VBA]'Paste as value should be used
    shCalculations.Select
    Range("getFirstCalculationColumn:getFirstCalculationColumn+getNumberOfDaysA rchived-1").Copy
    Range("getFirstCalculationColumn+1:getFirstCalculationColumn+getNumberOfDay sArchived").Paste
    [/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    shCalculations.Select
    Columns(getFirstCalculationColumn).Resize(, getNumberOfDaysArchived).Copy
    Columns(getFirstCalculationColumn + 1).Resize(, getNumberOfDaysArchived).PasteSpecial Paste:=xlPasteValues
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Nov 2008
    Posts
    41
    Location
    Hi xld,

    Thanks for the help.

    It does not work perfect yet though (it copies one column too much), and would like to learn as well. Could you explain what the resize function does?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Resize does exactly what it says, it resizes the range being processedby the number of rows and/or columns identified.

    Columns(getFirstCalculationColumn) is one column, so Resize makes more affected columns.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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