Target.Value = 100 does not seem to work, either. pls, help!
Target.Value = 100 does not seem to work, either. pls, help!
if i want cell A1 in sheet1 to have a value of 100, i would type in
Please Login or Register to view this content.
don't worry, there's a lot of people that are far more confused than you
but if you liked what i suggested. Click for me the "Add Reputation" - that way, we'd be both happy.
ag273: I cannot use what you suggested as I do not know the cell's reference. It changes. I have a combobox popping up in different cells and so I have to find a workaround. This is why my question was about setting a value to the cell with the reference Target.Address
if its the currently selected cell you're referring to, you can use the "activecell" range
so example, if I have my cursor on cell B3 (regardless of the worksheet) and i want that cell to get a value of 100, then i would write:
such statement can add the value of 100 to what ever cell the cursor is on.Please Login or Register to view this content.
ag273n: this does not seem to work- maybe because there is no active cell (as a guess) - while it is a combo box that is active (pardon my dilettante guesses)
wait, i just recalled that statement you ask of is found in the worksheet selection change sub...
like this:
now that code worked on me... every worksheet that has that code automatically puts 100 into the selected cell. Are you trying to do this in a single worksheet?Please Login or Register to view this content.
ag273n:
I have to write something like the below
Private Sub ComboBoxCode_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
'Hide combo box and move to next cell on Enter and Tab
Select Case KeyCode
Case 9
Target.Value = LookUpValue
ActiveCell.Offset(0, 1).Activate
'LookUpWord = ""
'ComboBoxCode.Visible = False
Case 13
Target.Value = LookUpValue
ActiveCell.Offset(1, 0).Activate
'LookUpWord = ""
'ComboBoxCode.Visible = False
Case Else
'do nothing
End Select
End Sub
But this does not run correctly - something is wrong with Target.Value = LookUpValue
the above code meant to put the value of LookUpValue (a name) into the cell where ComboBox is before another cell gets active and the combo box stops being active
the above code you have will never work, the sub doesnt accept a target variable or a range variable,
at the very bottom of the code, you'll need to add a line that will refer to a cell still so the code will add it on the cell
the target.value method will only work on subs like this:
notice it says "target as Range", the sub recognizes that its accepting a rangePlease Login or Register to view this content.
can you attach a sample workbook so i can take a look at it?
how to attach a file (I only know how to attach a file when starting a thread) - now there is not "attach" icon here
at the bottom where you type for a reply, it says "Go Advanced" click that, then below again, you will see "Manage Attachment"
click any cell in column L (lower than line 11) of tab Transaction - a combo box should pop up
oh, Target.Value = ComboBoxCode.Text appears to work!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks