Results 1 to 3 of 3

A counter and copy column problem

This is a discussion on A counter and copy column problem within the Excel Questions forums, part of the Question Forums category; I've some problem making a macro that will copy the information in Column B to Column C the first time, ...

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    51

    Default

    I've some problem making a macro that will copy the information in Column B to Column C the first time, then from Column B to Column D the next time and so on.

    I do know how to make the macro working by using a the Range and Cells command like:

    Counter = Sheets("Sheet1").Cells(1, 1)
    Range("B1:B6000").Select
    Selection.Copy
    Cells(1, Counter + 1).Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

    BUT since the excel file grows by roughly 1MB each time I run the macro, I can not use it. The strange part is that the file only grows by a few bytes when I mark Column B and use the copy/paste function to Column C, D, E etc.

    So, in order to save place I'm looking for a macro that can copy column. Can you help me?

    andy-s

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824

    Default

    Counter = Sheets("Sheet1").Cells(1, 1)
    Sheets("Sheet1").Columns("B:B").Copy
    Sheets("Sheet1").Columns(Counter + 1).PasteSpecial Paste:=xlValues, _
    Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    Try the above inplace of your original code...

    Tom

    [ This Message was edited by: TsTom on 2002-04-21 13:55 ]

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    51

    Default


    Yeah.... at last

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com