+ Reply to Thread
Results 1 to 7 of 7

Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    Canton, Michigan
    MS-Off Ver
    2010
    Posts
    11

    Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    Hello,

    I have recently started working with VBA, but I'm still pretty new to it. I need some help writing a code that copies a range of values from one sheet to another, but I only want to return the values that have the following criteria:
    1. The cells from the first sheet must be visible
    2. There must be a value (The number "1" for example) in a different column within that row.

    Input Page.JPGOutput Page.JPG

    I have attached an example of what I am trying to achieve. I would want to select the range shown on the input sheet, and copy/paste the correct values from columns "B" and "C" (from the input page) onto the output page as shown. Note that the values in row #3 wouldn't be copied because they're hidden. The values in row #4 wouldn't be copied either, because there isn't a number 1 in column "A". Any help would be greatly appreciated.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    This shall do:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    01-19-2015
    Location
    Canton, Michigan
    MS-Off Ver
    2010
    Posts
    11

    Re: Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    This works very well, thank you for your help. There are a couple of things I might want to change:
    1. The code seems to copy the number 1 along with the data. Is there a way to alter the range to only copy the values in column "B" and "C"?
    2. If I were to use a different column for the number 1's (say column "F" for example), how would I alter the code to reflect that change?
    3. Is there a way to have the value of the copied cells on the "Output" sheet link back to the original values on the "Input" sheet? That way any change on the input sheet would be reflected on the output sheet.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    1)
    Please Login or Register  to view this content.
    2) 1's in F copy B and C into A
    Please Login or Register  to view this content.
    3) quite different:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-19-2015
    Location
    Canton, Michigan
    MS-Off Ver
    2010
    Posts
    11

    Re: Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    Thanks again, this seems to have worked. The only issue that I ran into is that the actual document I'm applying this to has sheet names with spaces. The formula returns an error if I have a space in the name of my input sheet. In the example we have been using, is there a way to change the title of the sheet named "Input" to something with a space, say "Input Sheet" for example? I tried replacing the section "=Input!" with "=Input Sheet!", but that returned an error.

    It seems like a minor thing but I haven't been able to get it to work. Worst case scenario is I change the name and add "_" between my words. I have other codes that reference the current sheet name (with the spaces) though, so I'd hate to go through and rewrite everything. Thanks again for your assistance.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,650

    Re: Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    use single apostrophes, like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-19-2015
    Location
    Canton, Michigan
    MS-Off Ver
    2010
    Posts
    11

    Re: Need Help VBA Copying/Pasting Certain Linked Values Between Sheets

    Thank you, that's exactly what I needed. I was able to get the sheet to work as desired. Your help is greatly appreciated.

+ 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] copying and pasting more than one column between sheets
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2014, 11:53 PM
  2. Problem searching, copying and pasting selected cells between sheets
    By Torben_Fred in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2013, 05:55 PM
  3. copying cells and pasting them as linked picture
    By bagullo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2011, 11:25 AM
  4. Pasting a formula automatically accross sheets and then copying result
    By farmertml in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2009, 07:48 AM
  5. Modifying code for copying and pasting between sheets
    By jrpettit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2008, 05:09 PM

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