Results 1 to 10 of 12

Thread: Macro to copy data containing numeric values

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Aug 2012
    Posts
    40
    Rep Power
    0

    Macro to copy data containing numeric values

    I would like a macro to copy data containing numeric values from Col K to J for eg 4201K, W4250 etc

    I am battling to upload the sample data where I highlighted the numeric data in Col K that must be copied to Col J


    I have code to do this, but it does nothing



    Code:
     Sub Copy_Data()
    Dim sh As Worksheet, lr As Long, rng As Range, c As Range
    Set sh = Sheets(1)
    lr = sh.Cells.Find("*", sh.Range("A1"), xlValues, xlPart, xlByRows, xlPrevious).Row
    Set rng = sh.Range("K2:K" & lr)
        For Each c In rng
            If IsNumeric(Left(c.Value, 1)) Then
                c.Copy sh.Cells(Rows.Count, "J").End(xlUp)(2)
            End If
        Next
    End Sub
    Your assistance in resolving this is most appreciated
    Last edited by Flupsie; 04-05-2014 at 07:28 AM.

Similar Threads

  1. Replies: 0
    Last Post: 04-20-2013, 10:07 AM
  2. Macro to copy data in specific Columns
    By Howardc in forum Excel Help
    Replies: 0
    Last Post: 04-19-2013, 10:42 AM
  3. Extracting Numeric Values From Alphanumeric Text
    By Safal Shrestha in forum Excel Help
    Replies: 3
    Last Post: 03-21-2013, 12:04 PM
  4. Macro to copy data from a set of excel files
    By Sreejesh Menon in forum Excel Help
    Replies: 5
    Last Post: 11-15-2012, 11:17 AM
  5. Replies: 2
    Last Post: 11-08-2012, 01:15 PM

Posting Permissions

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