+ Reply to Thread
Results 1 to 2 of 2

Using a dropdown box to find and copy a row to a separate sheet

  1. #1
    Registered User
    Join Date
    03-06-2014
    Location
    United Kingdom
    MS-Off Ver
    Mac - Office 2011
    Posts
    8

    Question Using a dropdown box to find and copy a row to a separate sheet

    I have a table (called 'tblFuels' on worksheet"Fuel Data") which contains Fuel Names in column A, I have named the range 'FuelNames', there are several properties for each fuel in columns B to V.

    On a separate sheet i have a dropdown box which is populated by 'FuelNames'. When a fuel is selected from this dropdown list, and a button pressed, i would like the corresponding row to be copied and pasted in to a third sheet for use in calculations etc.

    The internet has given me several ways of doing something like this and I've given this one a crack, it just doesn't work.

    Sub Find_CopyRows()

    For i = 4 To Worksheets("Fuel Data").Range(“A64000”).End(xlUp).Row
    '("InputFuelSel") is the 'range name' of one cell which contains a dropdown list of all the fuels found in column A
    If Worksheets(“Fuel Data”).Range(“A” & i).Value = (“InputFuelSel”) Then
    'Copy the relevant row from A to V (this code gives me compile error at the "V")
    Worksheets("Fuel Data”).Range(“A” & i & : "V" & i &).Copy
    'Paste in to the second row from A to V, i want it to overwrite any data and not add a new row & only paste values not formulas.
    'This code gives me compile error for the '2' below.
    Worksheets(“Output”).Range (“A 2")

    'or something like this?
    Worksheets("Output").Range("A2").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False

    End Sub
    Any suggestions?

    Fuels Spreadsheet.xlsm

  2. #2
    Registered User
    Join Date
    03-06-2014
    Location
    United Kingdom
    MS-Off Ver
    Mac - Office 2011
    Posts
    8

    Re: Using a dropdown box to find and copy a row to a separate sheet

    Also, how would I select specific columns to copy as I will not use all of the properties in the calculation?

+ Reply to Thread

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: 02-25-2013, 02:27 PM
  2. [SOLVED] Recall relative cell by dropdown list on separate sheet
    By BrianATrease in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2012, 06:49 PM
  3. Find Minimum Value in Variable Range (On Separate Sheet)
    By FancyCorndog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2012, 01:42 PM
  4. Replies: 2
    Last Post: 02-09-2012, 05:56 AM
  5. need dropdown box to copy rows to other sheet/s
    By insight in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2009, 04:17 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