+ Reply to Thread
Results 1 to 8 of 8

How do I enter values into a range from an active cell.

  1. #1
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    How do I enter values into a range from an active cell.

    I have the following code.

    Please Login or Register  to view this content.
    Is it possible to do something like

    Please Login or Register  to view this content.
    But not by making an array? I think it involves relative positions but I am not sure.
    Last edited by 111StepsAhead; 04-20-2011 at 10:17 AM.

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: How do I enter values into a range from an active cell.

    Question: Why can't you use an array?

    Personally, from what you've shown, I'd do something like...
    Please Login or Register  to view this content.
    If you really really can't use an array then I'm happy to try to think of another way around, but this would seem to be the more straight-forward solution.

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

    Re: How do I enter values into a range from an active cell.

    How about something like...

    Please Login or Register  to view this content.
    Just like Kafrin, understand it is an array but seems to be the right way to go.
    HTH
    Regards, Jeff

  4. #4
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: How do I enter values into a range from an active cell.

    I appreciate the effort but I am still not sure if what you have will work for my situation. I am
    replacing a lot of code while trying to cut down on the number of lines.

    I have the same code in other sections of my worksheet but with different variables. I was
    planning on defining D somewhere and then using the universal definition throughout the
    code so if I had to change all the D's to C's I could do this by changing one line.

    I'd rather not define a unique array every time I have to use this code.

    My apologies for the disorganized thought process but for example purposes lets just say I have the following.

    Please Login or Register  to view this content.
    So what it comes down to is doing it your way doesn't appear to save me any time or cut down on lines of code. Yes, I am lazy but efficient.

  5. #5
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: How do I enter values into a range from an active cell.

    Quote Originally Posted by jeffreybrown View Post
    How about something like...

    Please Login or Register  to view this content.
    Just like Kafrin, understand it is an array but seems to be the right way to go.
    I like your code better because it is shorter which is part of the reason I am working on this project. To make things shorter. However, the range "A1" isn't relative to the active cell which is the other part of my problem currently. Any ideas?

  6. #6
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: How do I enter values into a range from an active cell.

    OK, so you need a sub that you send variables to, something like...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: How do I enter values into a range from an active cell.

    Thank a lot Kafrin.
    The final code I will use is this.

    Please Login or Register  to view this content.
    This will save me a huge amount of work in the future
    Last edited by 111StepsAhead; 04-20-2011 at 10:23 AM.

  8. #8
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: How do I enter values into a range from an active cell.

    Excellent, glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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