Results 1 to 9 of 9

How to copy specific cell values in worksheet to another worksheet in the same workbook?

Threaded View

  1. #1
    Registered User
    Join Date
    10-27-2014
    Location
    Coimbatore, India
    MS-Off Ver
    2007+2013
    Posts
    59

    How to copy specific cell values in worksheet to another worksheet in the same workbook?

    I hv a workbook with 3 sheets viz. OpgStk,Receipts,ClgStock
    In OpgStk and Receipts sheets, I have columns for ItemName ("K") and ItemLotNumber ("J"). There are about 1000 ItemNames and for each ItemName there are about 15 ItemLotNumbers in OpgStk and Receipts Sheets. I need to copy the ItemLotNumber from both the OpgStk and Receipts Sheets in the ClgStock Sheet. I have tried with the following but not successful. Of course, I have not considered Receipts Sheet in this as I thought once I get through with OpgStk and I can proceed to Receipts on the same lines. Data start from B7 and ends at P15007, with row 6 for column headers.

    Sub ClgStkPost()
        Dim K As Long, r As Range, v As Variant
        K = 7
        Dim w1 As Worksheet, w2 As Worksheet
        Set w1 = Sheets("OpgStk")
        Set w2 = Sheets("ClgStk")
        w1.Activate
        For Each r In Intersect(Range("K:K"), ActiveSheet.UsedRange)
            v = r.Value
            If InStr(v, "S4") > 0 Then
                r.Copy w2.Range(K, 1)
                K = K + 1
                
            End If
        Next r
    End Sub
    Any help?
    Last edited by alansidman; 10-27-2014 at 04:09 AM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to copy data from one workbook to a specific worksheet of another workbook
    By VidyaVallaba in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2014, 03:44 AM
  2. [SOLVED] Need to copy values from all files in folder from specific worksheet
    By jh51745 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-03-2013, 01:05 PM
  3. Copy Values from WorkSheet back to Another Workbook Replacing Values in Worksheet
    By bobwilson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-03-2006, 04:50 PM
  4. Replies: 1
    Last Post: 03-16-2006, 03:00 PM
  5. [SOLVED] Copy Worksheet to specific row in another workbook
    By GregR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2005, 03:05 PM

Tags for this Thread

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