Results 1 to 2 of 2

Copy and paste values without including the drop-down list

Threaded View

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    Madison, WI
    MS-Off Ver
    Excel 2010
    Posts
    5

    Copy and paste values without including the drop-down list

    The source data is collected using drop-down menus. In moving the data from one workbook to another, the drop-down lists are carried over into the destination cells. I have used both: paste special "values" and paste special "valuesandnumber formats". The code in the else statement produces the same result as the 2 step process above it. Thanks in advance

    Sub extractData(sourcedata, Dataset)
    
        Dim finalRow As Integer
        Dim rowCount As Integer
        Dim emptyRow As Integer
        Dim pasteRange As Range
           
        
    emptyRow = (Dataset.Range("A" & Rows.Count).End(xlUp).Row) + 1
    rowCount = sourcedata.Range("A" & Rows.Count).End(xlUp).Row
    
    If sourcedata.Cells(rowCount, 2) > 2 Then
    'Loop through Source - paste to Master
    
    With sourcedata
    
      If rowCount > 2 Then
            'Remove formatting
        .Cells.EntireRow.Interior.ColorIndex = 0
        .Cells.EntireRow.Borders.LineStyle = xlNone
        
            'Copy and Paste Data from source to dataset
        .Range(("A3:AX" & .Range("A" & Rows.Count).End(xlUp).Row)).Copy
        Set pasteRange = Dataset.Cells(emptyRow, 1)
        pasteRange.PasteSpecial ()
      Else
        .Cells.EntireRow.Interior.ColorIndex = 0
        .Cells.EntireRow.Borders.LineStyle = xlNone
        .Range(("A3:AX" & .Range("A" & Rows.Count).End(xlUp).Row)).Copy _
        Dataset.Cells(emptyRow, 1)
      End If
    'Application.CutCopyMode = False
    End With
    End If
    
    End Sub
    Last edited by Utz; 07-16-2014 at 08:03 AM. Reason: Formatting

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 05-14-2014, 12:52 AM
  2. How to restrict copy paste in drop down list?
    By Parwez in forum Excel General
    Replies: 5
    Last Post: 03-19-2013, 08:46 AM
  3. Replies: 1
    Last Post: 04-28-2008, 03:30 AM
  4. [SOLVED] Copy/Paste Drop Down List
    By Ivano in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-31-2006, 12:55 PM
  5. [SOLVED] copy the drop down list value and paste to next column
    By norika in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2005, 08:05 AM

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