+ Reply to Thread
Results 1 to 10 of 10

Simple VBA help

  1. #1
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Simple VBA help

    Please Login or Register  to view this content.

    I am returning a blank cell in this case. the cell that is referenced in Comment contains text. Im very new to VBA so i am sure it is something simple and stupid but i cant seem to source the error in this one. worksheet digest cell b6 contains a number that corresponds to a row of interest fyi, and i want to copy the value of the cell directly below it into the digest worksheet.

  2. #2
    Registered User
    Join Date
    06-19-2012
    Location
    Canada Eh
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    40

    Re: Simple VBA help

    I don't know if the following is the answer but try
    Please Login or Register  to view this content.
    I've seen people not use the .Value property but I always do just to be sure.

    EDIT: At 122 posts you should probably be using a better title than the one you have provided the forum.
    EF killed Mordred

    46 & 2 is just ahead of me!

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Simple VBA help

    When using the Cells() method, the rownumber is the first argument, and the columnnumber is the second argument
    So if the comment should be coming from sheets("user") column A, you need to have:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Simple VBA help

    still same scenario unfortunately

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Simple VBA help

    Hi kamelkid2

    Suggest you change the thread title to reflect the query being asked.. see the forum rules:-

    http://www.excelforum.com/forum-rule...rum-rules.html

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  6. #6
    Registered User
    Join Date
    06-19-2012
    Location
    Canada Eh
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    40

    Re: Simple VBA help

    I don't want to hijack this thread but my question is related (somewhat).

    @tigeravatar, is the .Value needed to draw out the value of the cell or does it not really matter?

  7. #7
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Simple VBA help

    Quote Originally Posted by tigeravatar View Post
    When using the Cells() method, the rownumber is the first argument, and the columnnumber is the second argument
    So if the comment should be coming from sheets("user") column A, you need to have:
    Please Login or Register  to view this content.
    thank you. at least i know my rudimentary understanding of variables is correct. now i just need to mind my p's and q's. thank you for quick help!

  8. #8
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Simple VBA help

    Quote Originally Posted by FortySixAndTwo View Post
    I don't want to hijack this thread but my question is related (somewhat).

    @tigeravatar, is the .Value needed to draw out the value of the cell or does it not really matter?
    taken from the guide i am using to learn VBA

    'Value is the default property for a Range object. In other words, if you omit a
    property for a Range, Excel uses its Value property'

  9. #9
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Simple VBA help

    @FortySixAndTwo, when referencing a single cell, the default property returned is the .Value, so it isn't actually necessary to specify .Value. However, if you are referencing more than a single cell, there is no default property returned, so then it becomes necessary to specify what you want out of that range object. Also, dates can cause a problem due to regional settings, and numbers can cause problems due to cell formatting or being stored as text, so its best to get those using .Value2 instead of .Value. Generally speaking, you should always explicitly declare what you're looking for as good practice.

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Simple VBA help

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


+ 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