Hello
I am trying to send me.AddressBar.text to activecell of sheet10 using this
method range of object Global_failed error is poping upPlease Login or Register to view this content.
Whats wrong here
ideas?
Best Regards
Imran Bhatti
Hello
I am trying to send me.AddressBar.text to activecell of sheet10 using this
method range of object Global_failed error is poping upPlease Login or Register to view this content.
Whats wrong here
ideas?
Best Regards
Imran Bhatti
Teach me Excel VBA
The ActiveCell is a Range...
Please Login or Register to view this content.
Working.But what is the logic?why not activecell.text as the cell is full of text?
Go and read up on the TEXT, VALUE and VALUE2 properties...
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:
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.Please Login or Register to view this content.
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,
because textbox.Text property is read-and-write and (as a string-valued property) is faster then a variant-valued textbox.Value property.Please Login or Register to view this content.
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.
Thanks both of you John ,cytop for helping me understand that property.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks