+ Reply to Thread
Results 1 to 13 of 13

Copy past certain cells if cell is 1 to other sheet.

  1. #1
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Copy past certain cells if cell is 1 to other sheet.

    I tried to record a Macro (because i cant write one) to copy past certain cells to a other sheet if a specific cell is 1.
    I filter the one's en then copied the cells. But every time it works when i'm recording but when i run the macro it messus up.

    Also tried copy past the hole table n delete the 0 after copy

    Can someone help?

    Here is a example.
    Attached Files Attached Files
    Last edited by Frigide; 02-03-2019 at 08:15 AM.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,153

    Re: Copy past certain cells if cell is 1 to other sheet.

    ? From where to where, and what ?

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Copy past certain cells if cell is 1 to other sheet.

    There is no code in your sample, how can we see what the problem is?

  4. #4
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Copy past certain cells if cell is 1 to other sheet.

    I'm sorry!

    I know the problem now. When you record in a sheet and run it in a other sheet it is running in the active sheet.
    What i dont now yet is how to specific run it in the right sheet. For example i want this code only run in the Chemicalien sheet!
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Copy past certain cells if cell is 1 to other sheet.

    Try
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291
    Quote Originally Posted by Fluff13 View Post
    Try
    Please Login or Register  to view this content.
    I'm not home now. But when i put in front of a code it Will be for chemicaliën sheet only?

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Copy past certain cells if cell is 1 to other sheet.

    Yes, it will only copy the values on that sheet

  8. #8
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Copy past certain cells if cell is 1 to other sheet.

    I'm try te understand! Why is this not working?

    Please Login or Register  to view this content.
    and is this working
    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Copy past certain cells if cell is 1 to other sheet.

    You need to add a period (.) before the Range with your code

  10. #10
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Copy past certain cells if cell is 1 to other sheet.

    So this should work but isn't working.

    Please Login or Register  to view this content.

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: Copy past certain cells if cell is 1 to other sheet.

    Should have put my brain in gear before making post#9

    You can only use select on the active sheet. So that code will not work.
    As I showed there is no need to select ranges, it only slows things down.

  12. #12
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,153

    Re: Copy past certain cells if cell is 1 to other sheet.

    Quote Originally Posted by Frigide View Post
    ... So this should work but isn't working ...
    As above Fluff13 ...
    Is the "Chemicalien" sheet active at the time of copying ?
    The reason may be "Selection" - "Returns the selected object in the active window for an Application object".
    If another sheet is active than the one to which we refer, an error will be generated.

  13. #13
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Copy past certain cells if cell is 1 to other sheet.

    I solved this. I'm tying to learn how to write macro. I'm getting better and better. Bur lack of time because of a lack of a good tracking doc at work i'm asking allot.
    I just record a Marco. It is doing exactly what i want. But it is copying the field instead of insert it. Because of that the last row is overwrite and i need that because it is my anchor for the charts. It has to insert with the same condition because of the conditional formatting!
    Maybe i should make a new topic but here it goes!

    Please Login or Register  to view this content.

+ 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. one time entry sheet with copy and past values for certain cells only
    By abedfarhat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2017, 05:13 AM
  2. [SOLVED] Copy past in other sheet empty cell, need help
    By exe99 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-04-2015, 11:00 AM
  3. copy and past cell from multiple sheets into master sheet
    By asqw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2014, 07:10 AM
  4. copy and past cell on multiple sheets into master sheet
    By asqw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2014, 07:09 AM
  5. [SOLVED] Copy row of any cell with date in the past and paste to new sheet
    By jeetamin in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 01-30-2014, 02:07 PM
  6. macro to copy certain cells and past to another sheet.
    By alwinaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2013, 08:48 AM
  7. User Form to Copy/Past arow to different cells in different sheet
    By karimretina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2013, 06:32 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