Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 6 of 6

Thread: Copy Active Cell Down Adjacent Range To Right

  1. #1
    Join Date
    16th April 2009
    Location
    USA
    Posts
    51

    Copy Active Cell Down Adjacent Range To Right

    Split from: http://www.ozgrid.com/forum/showthread.php?t=135940

    Thanks, as I was working through this the first step was to clear the contents of the cells. After they are cleared, I have another sub that then goes and retreives a unquie number and places it back at the top of the column that I just cleared.

    Would this same code that cleared the cells contents work to copy the contents of the active cell down that same column, until the cell to its right is blank? -R-
    Last edited by Dave Hawley; April 18th, 2009 at 08:21.

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    14th July 2004
    Posts
    10,539

    Re: Clear Range To Right Of Active Cell Down

    Randal

    Why do you need to clear the contents and then repopulate them?

    You should be able to put in the new value in one go.
    Boo!

  3. #3
    Join Date
    16th April 2009
    Location
    USA
    Posts
    51

    Re: Clear Range To Right Of Active Cell Down

    Here is the reason.. a given group of lines are saved as a group. (6-10 lines per group) and at the time of saving them all lines are assigned the same unique grp number. These grp numbers have a set of defined fields with values.

    One of the functions of the program I am working on, the user can go into the list of unique group numbers, select one, which imports that previously set of configured values, back into what I am calling the "configurater". I need to strip the old unique grp number so that after values are chg'ed to the users liking... they will have the option to resave it, however when saving it I have to reassign a new unique grp number to it. thus repopulating the cells with that new grp number leaving the old number intact and the new becomes a varient of the old, having to unique grps now.

    Hope this made sense! The first reply to this thread clears the cells nicely. I have another sub that gets the next unique number in sequence and pastes it to the first line of the new grp.

    Now all I have to do is copy that new grp number in the active cell down the rest of the colum until the cell to its right is blank.

    Actually the original code provided, clears the cells to the right... instead of the ones in the active column, but all I am doing with that, is chg'ing the starting point to one cell left of the one I want to chg... it works for what I need. Sorry for the lengthy reply... you asked..

    So do you have something that can use to copy what is in the active cell, down its own column, until a blank cell appears just to its right?
    -R-

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,717

    Re: Copy Active Cell Down Adjacent Range To Right

    VB:
    Sub FillActiveCellDownToRight() 
        If Not IsEmpty(ActiveCell(1, 2)) Then 
            Range(ActiveCell(1, 2), _ 
            Cells(Rows.Count, ActiveCell.Column + 1).End(xlUp)) = ActiveCell 
        End If 
    End Sub 
    
    

  5. #5
    Join Date
    16th April 2009
    Location
    USA
    Posts
    51

    Re: Copy Active Cell Down Adjacent Range To Right

    This is very close to what I need. Problem is that when I select a active cell, it copies that value in the next column to the right, when I need it to copy down its own column the value of the active cell.

    What I am doing is after clearing the contents of a column, I am putting a unique value.. at the top of that column, and I need that value copied down. (not the one to its left.) It would stop when it detects a blank cell the the column to its right.

    Basically whatever is in the active cell. Copy that down the same column as the active cell, until the cell to its right is blank. -R-

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    16th April 2009
    Location
    USA
    Posts
    51

    Re: Copy Active Cell Down Adjacent Range To Right

    I was play with this and got it!!
    VB:
    Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column + 1).End(xlUp).Offset(, -1)).Value = ActiveCell.Value 
    
    

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Replies: 4
    Last Post: November 29th, 2013, 20:38
  2. Look Up Range Values And Copy Adjacent Cells
    By oosha in forum EXCEL HELP
    Replies: 2
    Last Post: August 15th, 2008, 10:17
  3. Copy Range To Active Cell
    By Tom Boucek in forum EXCEL HELP
    Replies: 2
    Last Post: November 20th, 2007, 05:04
  4. Replies: 8
    Last Post: September 4th, 2007, 22:23
  5. Get Value Of Cell Adjacent To Active Cell
    By eehines in forum EXCEL HELP
    Replies: 3
    Last Post: October 25th, 2006, 12:07

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
  •  
porno