View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
nickra nickra is offline
external usenet poster
 
Posts: 7
Default Negative number morphing to a cell code

On Sep 29, 10:06 pm, Gary''s Student
wrote:
Any VBA we inserted is NOT needed and should be removed:

Right-click the tab name at the bottom of the Excel window and select:
View Code
This brings up a VBA window. If you see a macro in the pane, erase it and
close the VBA window.
--
Gary''s Student - gsnu2007

"nickra" wrote:
On Sep 28, 7:41 pm, Gary''s Student
wrote:
You are once again correct. If L11 is empty and you click on it and type:
-3
it should display:
-3
without any VBA. If it does not display:
-3
we can fix it. Remove the VBA and try the entry. What do you see??
What do you want to see??
--
Gary''s Student - gsnu2007


"nickra" wrote:
On Sep 28, 2:06 am, Gary''s Student
wrote:
You are correct.


If you select a cell, say L11, and enter -3 you will see:
-3
in the cell. However you wanted to see:
3+L11
in the cell. This means making the negative number into a positive number
and then appending the cell address to that positive number. That is what
the VBA macro does.
--
Gary''s Student - gsnu200747


"nickra" wrote:
On Sep 27, 12:44 am, Gary''s Student
wrote:
As coded this only works on cell B9. Even though it look complicated, its not:


1. right-click the tab name at the bottom of Excel
2. select View Code
this open a VBA window
3. paste my stuff in
4. close the VBA window


play around with entering positive and negative values in B9.


If you are nervious about VBA, just try it out on a fresh new workbook first.
--
Gary''s Student - gsnu200747


"nickra" wrote:
On Sep 24, 7:28 pm, Gary''s Student
wrote:
Sorry - use this version instead:


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B9")) Is Nothing Then Exit Sub
If Target.Value 0 Then Exit Sub
v = -Target.Value & "+"
Application.EnableEvents = False
Target.Value = v & Target.Address(RowAbsolute:=False, ColumnAbsolute:=False)
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200746


"nickra" wrote:
I know this is probably an easy one, but I can't find the right
button. Every time I type, say, -3, into a cell, it turns into -3 and
then adds the cell wherever my cursor is, like L11. So, I get 3+L11 in
the cell instead of -3. What do I need to do? It's gotta be simple, I
know.


Huh? I have no clue what you are talking about. Is there a simple
button to click to change this or something. Ic an't believe something
as simple as typing in a negative number would cause such a glitch.


What is VBA? And does this mean that everyone is used to
typing in a minus and a number in a cell and having it NOt
automatically be a negative number?t


I think you have it backwards. I type -3 into cell L11 and what
appears in the cell is "-3+D14" or whatever cell my cursor happens to
be sitting on. I just want to see -3 in cell L11. Surely I can do this
without learning VBA , no?


I do not see -3 in cell L11. I see "-3+D5" (D5 being where my cursor
just happens to sit and if I move my cursor more cell numbers will be
added.) So, how do I remove the VBA. Didn't even know I had it or what
it is, really.


What is a Macro? When I open op the view code, I get three windows.
The larger one says, a variety of things depending on what pull down
tab I use. Examples:

Private Sub Worksheet_Activate()

End Sub

Private Sub Worksheet_Calculate()

End Sub

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

End Sub

Private Sub Worksheet_Deactivate()

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

End Sub

Do I delete any of this or what? Astonished this takes so much just to
type a negative number in a cell.