+ Reply to Thread
Results 1 to 10 of 10

Creating a List specified column as a value - not as formula

  1. #1
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Creating a List specified column as a value - not as formula

    Good Evening,

    This is a multi-part request for assistance (please forgive, but I am very much a novice to vba, but I am always trying to learn and expand).

    I have a worksheet that I am wanting to create a list, into a separate worksheet, from a specified column (column A). However, column A of the original worksheet is based from a formula.
    Not only do I need the list to generate, disregarding the formula, I also need it to ensure no duplicates.

    Question 1: how can I create this list to paste as a value, and not a formula?
    (below is the current code I am using, which is not working correctly):


    Please Login or Register  to view this content.

    I attached an example file and inserted the current code (hope I did it correctly).


    I greatly appreciate your help!

    Kindest Regards,

    Paula
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,565

    Re: Creating a List specified column as a value - not as formula

    Code will add a Sheet named "SplitCode" if it does not exist.
    Please Login or Register  to view this content.
    Try on a copy of your original first.

  3. #3
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Re: Creating a List specified column as a value - not as formula

    Thank you so much for your help jolivanes - this worked perfect!

    So, now for the second part of this question: Instead of creating a new "SplitCode" sheet, is there a way to use this code to create the list in an already existing worksheet in the same workbook?
    And, can that same worksheet already have other occupied columns?

    Example: In my workbook, I have a worksheet called "Export." In the "Export" worksheet I have data already written in columns F - H. I would like to generate this list from the "CompanyX" worksheet to the "Export" worksheet - specifically in column A, without messing up the data that is already in columns F-H.
    Again, ensuring no duplicates are generated.


    Thank you so much for time and help!

    Kindest Regards,
    Paula

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,565

    Re: Creating a List specified column as a value - not as formula

    Maybe like this. Ensure that the references are proper.
    It will start adding data from the first empty cell on in Column A in sheet "Export"
    Please Login or Register  to view this content.
    Again, try on a copy of your workbook first Paula because changes made through code are not reversible.

  5. #5
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Re: Creating a List specified column as a value - not as formula

    Hello Jolivanes,

    Again, thank you so much for your help and time. I tried the code that you sent for the last post but nothing happened when the macro was run. I have attached another file, with the code included.
    So, to try to do a better job of explaining what I need, in full description (instead of in pieces or phases):
    The 2nd thing I would like to understand and see (using the attached example) is:

    I would like to copy columns A, D, F & H from the "AMS" ws, to columns A, B, C, & D of the "Billing" ws.

    -important points to note:
    - the list in the "AMS" ws will update daily,
    - so its important that when the data is pasted to the "billing" ws, it overwrites any already existing data based on the information matching in column A, and if the well name, from column A, does not already exist, it populates at the last entry

    Example: In the "AMS" ws (column A), Well AAA has 50 (column D), 80 (column F), & 130 (column H)
    tomorrow, in the "AMS" ws, Well AAA (column A) updates/changes to 60 (column D), 80 (column F), & 140 (column H)

    So, in the "billing" ws, i need the the updated numbers to match the Well name from column A

    AND: any new data (like adding Well XXX in column A) would automatically populate as the last entry of the pasted list.


    Gosh, I hope that all made sense. Please let me know if I need to provide a better example, and again, thank you so much!

    Kindest Regards,
    Paula
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,565

    Re: Creating a List specified column as a value - not as formula

    You're trying to go from the wrong sheet. The "sh1" and "sh2" are mixed up.
    Try so.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,565

    Re: Creating a List specified column as a value - not as formula

    Re: I would like to copy columns A, D, F & H from the "AMS" ws, to columns A, B, C, & D of the "Billing" ws.
    Sheet "AMS" Column D Header = "Produced" while Column B in Sheet "Billing" has a Header of "Date"
    Sheet "AMS" Column F Header = "Fresh" while Column C in Sheet "Billing" has a Header of "# Incidents"
    Sheet "AMS" Column H Header = "Total" while Column D in Sheet "Billing" has a Header of "Produced"
    Is that kosher?

  8. #8
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Re: Creating a List specified column as a value - not as formula

    1. First, I updated the code you provided, and it works great - thank you! So I can better understand, what is the "c.Value" for?


    2. Sorry about that - I meant to change the headers to match on both sheets. The headers that should be in columns A-D of the Billing should match the order of the headers I am wanting from the AMS worksheet. I have reattached the worksheet with the headers updated.


    Kind Regards,
    Paula
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,565

    Re: Creating a List specified column as a value - not as formula

    Try this (see attached)
    You can update(run the code) from either sheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jolivanes; 11-19-2019 at 06:57 PM.

  10. #10
    Forum Contributor
    Join Date
    07-23-2019
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    141

    Re: Creating a List specified column as a value - not as formula

    good morning Jolivanes,

    The code works great!!! Thank you so much for all your help - you are awesome!

    Kindest Regards,
    Paula

+ 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. [SOLVED] VBA Creating a list of unique values from one column based on criteria from another column
    By bilbo85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2016, 02:38 PM
  2. [SOLVED] Creating Single Column List from multi-row/column table and removing blanks
    By ChemistB in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-10-2014, 02:23 PM
  3. Creating validation list from table column based on data in another column
    By dreamthrum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-11-2013, 08:38 PM
  4. Creating 2 Column List Based on 1 Column of Data... with a catch. :)
    By samebito in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2013, 06:41 PM
  5. Creating list of values which appear more than once in a column
    By Rabi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2007, 06:26 AM
  6. creating a list of column headers
    By rfhurley in forum Excel General
    Replies: 1
    Last Post: 07-27-2006, 06:42 PM
  7. creating a list of letters in a column
    By Lila in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2006, 12:30 AM

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