+ Reply to Thread
Results 1 to 4 of 4

Writing data from one column and writing it to another

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Writing data from one column and writing it to another

    Practicing reading and writing data from and to ranges. How do I read values from a range in col R, whereas column R has a varying number of rows, to a range in column A? The following does not work and don't understand why. Thanks for any help!!

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Writing data from one column and writing it to another

    There are many ways you could do this...

    Here's one way I would probably do it...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    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: Writing data from one column and writing it to another

    Multiple problems.

    Range("R1").CurrentRegion will not give you a range in column R, it will give you the region that contains R1. A region may include any number of rows and columns. A region is defined as the area containing the specified range bounded by blank rows and blank columns.

    Range("A27:A") is not a valid range expression. That gives you a runtime error.

    If you want to copy all of the data in column R starting in row 1 to column A starting in row 27, here is one way:

    Please Login or Register  to view this content.
    Note that will copy cells, not values. There are other ways to do this as well, depending on exactly what result you want.

    ETA: jeffrey's solution will copy just the values, which is maybe what you really want to do.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  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: Writing data from one column and writing it to another

    A way to copy values is

    Please Login or Register  to view this content.
    Not better or worse, just another method.

+ 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. Writing data on last empty cell in a column
    By earlyyyyyy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2016, 06:11 AM
  2. [SOLVED] Writing a Cell data into another column 6 times - Google Spreadsheet
    By cemsultan in forum Excel General
    Replies: 5
    Last Post: 05-11-2016, 05:03 PM
  3. Writing Data to first empty cell in column A
    By edens2021 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2015, 02:42 PM
  4. Writing random number in column
    By love_sick7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2013, 10:30 PM
  5. Writing a Macro to automatically add and copy data to another column
    By Matthew_12345 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-17-2011, 03:00 AM
  6. Writing formula to column using macro
    By alien3011 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-08-2007, 10:58 PM
  7. Help needed Writing formula that totals data at end of column
    By sid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-12-2006, 02:25 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