+ Reply to Thread
Results 1 to 10 of 10

Set range problem

  1. #1
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Set range problem

    Hi,

    In the uploaded file I would like to run the code in different sheet, right now if you type user in sheet3 it will return as name, I would like to run it in sheet1 and only in selected cells (A1:A20, A22:A25, B1:B20, B22:B25). Can someone amend the code.

    Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Set range problem

    No modification, the solution is visible from what you have.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Set range problem

    You have to put the code into sheet1 for it to work in sheet1. Press Alt + F11 to get to VBA editor. Paste this code into the Sheet1. It changes the area that calls the dictionary to the ranges you specified.

    Please Login or Register  to view this content.
    Last edited by Hawkeye16; 07-21-2014 at 08:58 AM. Reason: changed code to use UserLog for dictionary
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  4. #4
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Set range problem

    Hi Hawkeye16, can I ask for a check that if a username is not on the list then MsgBox?

    Thanks

  5. #5
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Set range problem

    Sure I believe it would be something like this (untested) Red code added.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Set range problem

    I got the message but it let me enter the value, would it be possible to clear the cell if username is not on the list?

    Thanks

  7. #7
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Set range problem

    double post
    Last edited by Blokeman; 07-21-2014 at 12:20 PM. Reason: double post

  8. #8
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Set range problem

    Can you use inputbox instead? ChangeEvents is conflicting with my other macros.

    Thanks

  9. #9
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Set range problem

    If you use turn of enableevents, it shouldn't interfer.

    Try this (in the Sheet1 module) and see attached:
    Please Login or Register  to view this content.
    Hope it helps!

    Cheers,
    berlan
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Set range problem

    Hi berlan,

    Thanks for the response, I made some changes to my file so it affect this code too, sorry about this but I would like this to be a Sub routine insted of ChangeEvent, I uploaded a sample file and this sub routine will be called in cells B6 to B8.

    Thanks
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Set range problem

    Just an update:

    Some of the problems are solved on this thread;
    http://www.excelforum.com/excel-prog...d-nothing.html

+ 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. Problem using loop for sending excel range in email body using Range to HTML code
    By drajanm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-24-2012, 03:17 AM
  2. Replies: 15
    Last Post: 04-25-2012, 05:21 PM
  3. Last row in specified range problem
    By losmi8 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2010, 09:36 PM
  4. Range problem - I think
    By aikidokid in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-06-2007, 01:29 PM
  5. Range problem
    By David Goodall in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2005, 06:05 AM

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