+ Reply to Thread
Results 1 to 4 of 4

VBA HLOOKUP and Paste Special with Values and Number Format

  1. #1
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    VBA HLOOKUP and Paste Special with Values and Number Format

    I have a macro that currently uses an HLOOKUP to get a value (single cell) from one workbook and set that value in to a second workbook. I thought my method was working great until I noticed I have a few EURO values mixed in with mostly USD numbers. I need to figure out how capture the value and format and do a PasteSpecial in to my new workbook.

    My current code looks like this;
    Please Login or Register  to view this content.
    I'm thinking I need to find a way to get the cell address of the HLOOKUP and from there I can copy that cell and do a PasteSpecial. Something like this in theory;
    Please Login or Register  to view this content.
    I've tried a few different things and have come up short on all of them. Any help/suggestions would be appreciated.

    Thanks,
    --Razor

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: VBA HLOOKUP and Paste Special with Values and Number Format

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: VBA HLOOKUP and Paste Special with Values and Number Format

    Thanks, allow me to prepare something and I will upload.

  4. #4
    Registered User
    Join Date
    12-02-2021
    Location
    PA, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: VBA HLOOKUP and Paste Special with Values and Number Format

    So I had time to put some stuff together. My issue, how do I copy the information from the data set files, and paste them in to the report spreadsheet matching the source format?
    In this example sites 1, 2, 5, and 6 are USD. Sites 3, 4, and 7 are in Euro's (highlighted orange) but getting copied in as USD. I'm assuming I need to do some type of PasteSpecial, but I can't figure it out.

    How my project is designed to run:
    1. The data set files go in their own sub folder.
    2. Open the report file.
    3. With the report file open, run the sub BuildDatasheet from the VBA editor.

    Note: I commented out a sort and some additional work that is done after the data is brought in to the worksheet. I had to do some work to remove identifying code/notes/data, etc. Hopefully the important stuff is still easy to follow. Please let me know if there are any questions.
    Attached Files Attached Files

+ 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. Copy and Paste Values as Number Format
    By DanielGordo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2014, 10:13 PM
  2. copy formula and paste for new data added and autofill.....and paste special values
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2014, 07:40 AM
  3. Paste values in a column, then apply custom number format
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2013, 05:17 AM
  4. Replies: 1
    Last Post: 12-05-2012, 11:37 AM
  5. Replies: 2
    Last Post: 03-27-2012, 02:49 PM
  6. Changing Paste Special to Values and Format
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2010, 06:25 PM
  7. Format Paste Special - is there a way to do this ?
    By SteveW in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-20-2006, 02:55 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