+ Reply to Thread
Results 1 to 5 of 5

Weird behaviour of column copy

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Weird behaviour of column copy

    Hello everybody
    I have this code in workbook open
    Please Login or Register  to view this content.
    The code is supposed to copy the contents of column AH to AM

    The sheet4 is hidden .. the code would make it visible and after the copy of column AH it would be hidden
    The weird behaviour I stated is that AM column have no data..
    The data copied to column BT
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Weird behaviour of column copy

    I Fixed it
    thanks
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,747

    Re: Weird behaviour of column copy

    Not sure what you are trying to do. But this
    Please Login or Register  to view this content.
    would be the entire column AM ... you are trying to resize from row 1 to the number of rows.

    However, this:

    Please Login or Register  to view this content.
    means you are trying to refer to column AM in relation to column AH. The dot (.) links .Range("AM1").Resize(.Rows.Count, 1).Value = .Value to .Range("AH1", .Cells(.Rows.Count, "AH").End(xlUp)) which, in turn, is linked to Sheet4. So, in this case, .Range("AM1").Resize(.Rows.Count, 1).Value = .Value means .Range("AM1").Resize(48, 1).Value = .Value and:

    Please Login or Register  to view this content.
    It's column BT because that is column AM relative to column AH.

    If you explain what it is you intended, I'm sure we can help.

    Possibly this:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Weird behaviour of column copy

    Thanks Mr TMS for your great help
    I stated that I would copy column AH to AM

    so after little modification of yours it worked perfect
    Please Login or Register  to view this content.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,747

    Re: Weird behaviour of column copy

    You're welcome. Thanks for the rep.

+ 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. Getting a FALSE value from this formula, weird formula behaviour
    By PMcG in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-30-2012, 04:58 PM
  2. [SOLVED] Weird Filepath Behaviour
    By timbo1957 in forum Excel General
    Replies: 1
    Last Post: 08-05-2012, 04:56 PM
  3. Weird behaviour of the BeforeSave procedure when fired by Me.Save
    By mach128x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2011, 09:08 PM
  4. Weird behaviour for a basic sum
    By barid in forum Excel General
    Replies: 3
    Last Post: 08-27-2009, 07:38 AM
  5. Weird Button Behaviour
    By roasty_1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2008, 04:34 AM
  6. [SOLVED] Excel2000: Weird behaviour in VBA
    By Arvi Laanemets in forum Excel General
    Replies: 3
    Last Post: 02-01-2006, 10:14 AM
  7. Weird Cell Behaviour
    By Matt in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-18-2005, 02:05 PM
  8. Excel2000: Weird chart behaviour
    By Arvi Laanemets in forum Excel General
    Replies: 2
    Last Post: 09-06-2005, 03:05 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