Consulting

Results 1 to 5 of 5

Thread: Garbage data is copying to other sheets column?

  1. #1
    VBAX Regular
    Joined
    Jun 2010
    Posts
    58
    Location

    Garbage data is copying to other sheets column?

    Hi,
    I am trying to copy data from one sheet to other sheet. For some column its working fine but when I am trying to copy date column its giving garbage value.

    One more issue is every time when I am running the macro data is copying to next row of sheet2.But I want to overwrite the sheet2 data.It will start copy from 2nd row.

    Please find the attachment and do the needful.

    Thanks,
    Attached Files Attached Files

  2. #2
    VBAX Regular
    Joined
    Jan 2011
    Posts
    62
    Location
    Bunty,

    These are not garbage values click on the value which is like [VBA]
    40494.2465
    [/VBA]

    Right click format cell and select date format...

    Please Clear the senario what you want to copy and how ?

    Cheers
    farrukh

  3. #3
    VBAX Regular
    Joined
    Jan 2011
    Posts
    62
    Location
    Why not some thing like that your code which is in attached file?

    [vba]
    Sub CopyPaste()
    With Sheets("Sheet1")
    .Range("A1:A65536").Copy
    End With
    Sheets("Sheet2").[A1:A65536].PasteSpecial Paste:=xlValues
    With Sheets("Sheet1")
    .Range("b1:b65536").Copy
    End With
    Sheets("Sheet2").[b1:b65536].PasteSpecial Paste:=xlValues
    on error resume next
    Sheets("Sheet2").select
    Columns("B:B").Select
    Application.CutCopyMode = False
    Selection.NumberFormat = "m/d/yyyy"
    End Sub
    [/vba]


    Cheers
    farrukh

  4. #4
    VBAX Regular
    Joined
    Jun 2010
    Posts
    58
    Location
    Hi Farrukh,

    It's working fine.Is it possible to filter the data (using filter option from the menu) and copy only filtered data to other excel file?

    Thanks...
    Last edited by bunty; 02-22-2012 at 01:18 PM.

  5. #5
    VBAX Regular
    Joined
    Jan 2011
    Posts
    62
    Location
    Hi Bunty,

    Please record a macro that wil based on your string values it will solve your issue and for copy purpose you can use the same code which is on below post.


    Cheers
    farrukh

Posting Permissions

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