+ Reply to Thread
Results 1 to 7 of 7

Range using Variables

  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Range using Variables

    Hi all,

    I wondering how you would make this work.

    I want:
    • Take the Date that is input into 'datefrom2' and search on the year to find it
    • Then when found move 3 columns across
    • Then input the character "H" into the cell
    • Then search for the Date that is input into 'dateto2' , move across 3 columns and input the character "h"
    • I then want all the cells between 'datefrom2' and 'dateto2' to fill with the charactor "H" aswell.

    I really hope that makes sense. I started writing one below but I am not great at VBA.

    Please Login or Register  to view this content.
    Last edited by subtilty; 12-02-2011 at 05:23 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Range using Variables

    It will be good if you attach the sample workbook you are using this code on. We can work through it and assist you better.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Range using Variables

    Apologises, I have attached an example and noted it.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Range using Variables

    Any one?

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Range using Variables

    Use this code -
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Range using Variables

    This can be done with slighly less code and a bit faster with this

    Please Login or Register  to view this content.
    Please take time to read the forum rules

  7. #7
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Range using Variables

    Thanks very much

+ 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