+ Reply to Thread
Results 1 to 7 of 7

Can pasting ignore hidden columns?

  1. #1
    Registered User
    Join Date
    11-27-2017
    Location
    UK
    MS-Off Ver
    Home
    Posts
    19

    Question Can pasting ignore hidden columns?

    Hi, if I copy a number of horizontal cells and paste them over hidden columns, the data goes into the hidden columns. Is there a way to to paste the data onto the spreadsheet and have it ignore the hidden cells.

    Just in case I didn't explain that clearly I'll give an example, if I copy ten horizontal cells and paste it at A1 while having column B hidden, I will see only 9 cells pasted in, since the second one is hidden. I want to paste it and have the visible ten cells filled with the data.

    Any help appreciated.
    Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Can pasting ignore hidden columns?

    Do you mean you want to copy say A1:J1 from one sheet and paste to another sheet where column B is hidden so that A1 goes to A1, and B1:J1 goes to C1:K1 ?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Can pasting ignore hidden columns?

    Basically the answer is no. If copy a horizontal range of six columns and paste it to range with a hidden column, you will see only five columns of data in the destination range.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Can pasting ignore hidden columns?

    I believe that Richard has correctly paraphrased your question and I also believe this would require a macro.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Can pasting ignore hidden columns?

    Quote Originally Posted by JLGWhiz View Post
    Basically the answer is no. If copy a horizontal range of six columns and paste it to range with a hidden column, you will see only five columns of data in the destination range.
    Yes indeed. That's what happens now. Is that statement of yours a confirmation of that and you want something else to happen? If so what?.

    My post #2 was seeking to establish what you wanted to see. I'd assumed copying 10 columns but since you're using 6 in your latest post let's put the question again.

    If the numbers 1 to 6 are in A1:F1 and you copy them to A1 in a another sheet where column B is hidden, do you want to see numbe 1 in A1 and numbers 2 to 6 in C1:G1?

  6. #6
    Registered User
    Join Date
    11-27-2017
    Location
    UK
    MS-Off Ver
    Home
    Posts
    19

    Re: Can pasting ignore hidden columns?

    Quote Originally Posted by Richard Buttrey View Post
    Yes indeed. That's what happens now. Is that statement of yours a confirmation of that and you want something else to happen? If so what?.

    My post #2 was seeking to establish what you wanted to see. I'd assumed copying 10 columns but since you're using 6 in your latest post let's put the question again.

    If the numbers 1 to 6 are in A1:F1 and you copy them to A1 in a another sheet where column B is hidden, do you want to see numbe 1 in A1 and numbers 2 to 6 in C1:G1?
    Hi Richard, you're first post described exactly what I want to do as well as the last line of the quote above, to simply paste a row of cells into the cells that are visible, but I think you may have confused JLGWhiz for me.

    But yes, you are understanding my problem correctly.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Can pasting ignore hidden columns?

    In that case you'll need a macro

    One way would be for the macro to copy the data and paste it to A1, then identify which of the columns it's been posted two are hidden and then copy and paste the hidden column and cells to the right pasting that copied range offset one column to the right.

    The other way if the hidden column is known in advance would be to temprarily insert a blank column in the original data where the hidden column is located in the paste range, and copy the 7 cells to A1. Then delete the temporary column.

+ 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. Code to ignore hidden rows and columns, does this work please?
    By Steve@Rugby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2017, 07:17 PM
  2. How do you ignore hidden COLUMNS in a countif() function
    By Jayson Mora in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-24-2014, 08:05 AM
  3. Counta ignore hidden columns
    By JSmith1504 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2014, 10:12 AM
  4. Replies: 3
    Last Post: 06-25-2013, 10:27 AM
  5. pasting with hidden columns
    By spinkung in forum Excel General
    Replies: 2
    Last Post: 08-17-2007, 06:25 AM
  6. Pasting over hidden columns
    By Huber57 in forum Excel General
    Replies: 5
    Last Post: 03-28-2006, 02:35 PM
  7. [SOLVED] PLEASE HELP - Pasting Cells to WrkSheet with Hidden Columns
    By Rob the Winer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2005, 04:17 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