+ Reply to Thread
Results 1 to 7 of 7

VBA fill inbetween two points

  1. #1
    Registered User
    Join Date
    04-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    VBA fill inbetween two points

    Hi, kinda a noobie at VBA here. I am trying to get, on a button press, to have the cells between two points be filled with just a 1 when i press a button on the worksheet. The two points are different each time and the cells have formulas in them which is what defines the start and end points so the function will have to overwrite these. I am basically trying to achieve this at the press of a button and just for the fill to right one.

    Any help is greatly appreciated

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: VBA fill inbetween two points

    You will need to provide more information. Are the 2 cells in she same column, same row, or random? Will you use your mouse to highlight the cells before you trigger the macro? Would the formulae be replaced with a 1, or kept?

  3. #3
    Registered User
    Join Date
    04-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: VBA fill inbetween two points

    example.png

    Similar to that picture. I need to fill in all the red blocks with one click. The only cells in the sheet with just a 1 in it will be the ones that need doing. I don't need to keep the formula it just needs to be overwritten.

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: VBA fill inbetween two points

    Why don't you just highlight the range where you want the 1s, type a 1 and then press Ctrl-Enter No Vba required

  5. #5
    Registered User
    Join Date
    04-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: VBA fill inbetween two points

    Because this sheet goes on for over 100 rows and none of them are in line

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: VBA fill inbetween two points

    try
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: VBA fill inbetween two points

    This is one of the things I like about helping on these forums, is you always learn something new. Never hear of the specialcells method before, nor the usedrange property. Both very useful tools

+ 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