Results 1 to 2 of 2

Reformat pasted data to number format

Threaded View

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    germany
    MS-Off Ver
    Office 365 Pro (Excel 2016)
    Posts
    45

    Reformat pasted data to number format

    HI,

    I have used the following code to copy values from a source file into a target one.
    However once the values are pasted they are not formated as numbers anymore.
    What needs to be added to the code/ how does it have to changed so that the values are converted back number Format.
    Can someone help`?

    Many thanks for your help


     
    Cells.ClearContents
        Range("A2").CopyFromRecordset rs
        Dim cell As Range, i As Long
        With Range("A1").CurrentRegion
            For i = 0 To rs.Fields.Count - 1
                .Cells(1, i + 1).Value = rs.Fields(i).Name
               Next i
            .EntireColumn.AutoFit
        End With
    End Sub
    Last edited by pvp; 07-15-2015 at 09:55 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to reformat data in horizontal format to a proper Data table
    By dkrishman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2015, 10:37 AM
  2. Replies: 2
    Last Post: 03-11-2015, 10:08 PM
  3. [SOLVED] Number format not applied to pasted data
    By goisisi in forum Excel General
    Replies: 9
    Last Post: 01-06-2014, 10:40 PM
  4. Macro to reformat data in horizontal format to a proper Data table
    By hkaushal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2013, 08:47 PM
  5. Quick Macro to Reformat Data into specific format
    By Seraph122 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-23-2012, 07:13 AM
  6. Pasted number format wrong
    By JoeMAn12 in forum Excel General
    Replies: 3
    Last Post: 05-14-2008, 09:10 AM
  7. Reformat data to vertical format
    By Psydwaze in forum Excel General
    Replies: 1
    Last Post: 06-16-2005, 01:05 PM

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