+ Reply to Thread
Results 1 to 6 of 6

Sending textbox value to activecell

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Sending textbox value to activecell

    Hello

    I am trying to send me.AddressBar.text to activecell of sheet10 using this

    Please Login or Register  to view this content.
    method range of object Global_failed error is poping up

    Whats wrong here
    ideas?

    Best Regards
    Imran Bhatti
    Attached Files Attached Files
    Teach me Excel VBA

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Sending textbox value to activecell

    The ActiveCell is a Range...

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Sending textbox value to activecell

    Working.But what is the logic?why not activecell.text as the cell is full of text?

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Sending textbox value to activecell

    Go and read up on the TEXT, VALUE and VALUE2 properties...

  5. #5
    Registered User
    Join Date
    08-09-2015
    Location
    CzR
    MS-Off Ver
    MS Office 2013
    Posts
    41

    Re: Sending textbox value to activecell

    Range.Value property (the default property for the range object) operates with variants, while Range.Text property with strings. Unfortunately, Range.Text is read-only hence cannot be used on the left side of '='.

    The correct code is:

    Please Login or Register  to view this content.
    You don't need 'Me', userforms know their childs, i. e. controls. You'd need 'Me' only if you created the textbox in the runtime; you'd have to write Me!AddressBar (with '!') then.
    Because there's a variant property ActiveCell.Value on the left side, I write a variant property on the right side, too.

    Caution! If you want to place the content of AddressBar into another textbox, say, NameBar, you use the Text properties rather then the Value ones,

    Please Login or Register  to view this content.
    because textbox.Text property is read-and-write and (as a string-valued property) is faster then a variant-valued textbox.Value property.

    In other words, find help pages for all objects you need to work with and read the help carefully. The click 'object members' in the help page bottom and learn all object's methods and properties; not only what they do but also what types of values they use (integers, longs, singles, doubles, strings, variants, dates, ranges, ...).
    You get the help page when, in your code, you place cursor on the word you need a help to, and press F1.

  6. #6
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Sending textbox value to activecell

    Thanks both of you John ,cytop for helping me understand that property.

+ 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. Sending text from textbox to next available row
    By NJH88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2013, 10:54 AM
  2. Sending Text to TextBox with same class name
    By lee1000d in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2013, 02:18 PM
  3. [SOLVED] How to put textbox value in activecell?
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2013, 03:28 PM
  4. [SOLVED] textbox to first empty column in activecell's row
    By mabulco in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2013, 11:07 AM
  5. Replies: 1
    Last Post: 04-20-2012, 09:49 PM
  6. Find using TextBox or ActiveCell
    By PCArmour in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-13-2011, 01:20 PM
  7. Sending Textbox values to Table confused
    By mribnik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2011, 07:39 PM

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