HELP WITH VBA

B

bullandbear1987

I am trying to finish writing some simple program.


My problem is that when I try and change the arguement from SELECTION
CHANGE to CHANGE, it doesn't work. Can someone help?


Private Sub Worksheet_Change(ByVal Target As Range)
If Worksheets("Sheet3").Range("B3").Value = 2 Then
Worksheets("Sheet1").Range("F3") =
Worksheets("Sheet3").Range("F4").Value
End Sub


My second problem is that I would like my data rather than appearing in



a cell, appear in a TEXT BOX. What do I do?
 
G

George Nicholson

Copying your exact same post from 3 days ago word-for-word might get you the
exact same responses, word-for-word.
(i.e., consider rephrasing the question next time).
it doesn't work
What doesn't work, the existing code or making the change from Change to
SelectionChange?
Or "it" doesn't do what you want it to? (and what is it that you want to do
that "it" isn't doing?)
 
B

bullandbear1987

I have tried to change it from Selection Change to Change. At least
when I use Selection Change, the programming performs the action (ie
changing a cell; and then the display appears).

When I attempt to use CHANGE, it no longer displays a value, as with
Selection Change.

The second question, was how can I make it display in a text box? I
think that question was fairly straight-forward. How come you couldn't
help me answer that question?
 
D

damorrison

You may require a target address

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "your range here" Then
'your code here
End if
End Sub
looking at your formula, I might think you are trying to do a
worksheet change without being inthe worksheet,
I have never worked on :
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)

but you may have to!
if you name your range, you can just enter the the name in your code
instead of typing : Worksheets("Sheet3").Range("F4")
you can type
Range("namedRange")
 
Top