Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1
The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
No problem in you line of code. This works just fine:
Sub hyui() v = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 MsgBox (v) End Sub -- Gary's Student gsnu200706 "Corey" wrote: TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
Works fine for me too.
David "Gary''s Student" wrote: No problem in you line of code. This works just fine: Sub hyui() v = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 MsgBox (v) End Sub -- Gary's Student gsnu200706 "Corey" wrote: TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
try
TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
Thanks Tom, but i seem to STILL get ONLY the MAX value.
If i do this: TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 2) then i get the MAX + 1 ???? "Tom Ogilvy" wrote in message ... try TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
If you put
=max(a:a) in an empty cell on the Data sheet, what do you see? Any chance that the thing that looks like the max is really not a number--it's text? Corey wrote: Thanks Tom, but i seem to STILL get ONLY the MAX value. If i do this: TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 2) then i get the MAX + 1 ???? "Tom Ogilvy" wrote in message ... try TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
Found out why.
I was adding the "A" and i have the Data Adding it also. Now i need to remove the "A" when it is placed in the Data Sheet leaving ONLY the Numerical value. EG. "A 1234" to be "1234" how do i do that ? "Corey" wrote in message ... Thanks Tom, but i seem to STILL get ONLY the MAX value. If i do this: TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 2) then i get the MAX + 1 ???? "Tom Ogilvy" wrote in message ... try TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
How are you putting the value in the cell. If by a link, do it with code
instead. -- Regards, Tom Ogilvy "Corey" wrote in message ... Found out why. I was adding the "A" and i have the Data Adding it also. Now i need to remove the "A" when it is placed in the Data Sheet leaving ONLY the Numerical value. EG. "A 1234" to be "1234" how do i do that ? "Corey" wrote in message ... Thanks Tom, but i seem to STILL get ONLY the MAX value. If i do this: TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 2) then i get the MAX + 1 ???? "Tom Ogilvy" wrote in message ... try TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
I am using code like :
Range("A1").Value = TextBox1.Value "Tom Ogilvy" wrote in message ... How are you putting the value in the cell. If by a link, do it with code instead. -- Regards, Tom Ogilvy "Corey" wrote in message ... Found out why. I was adding the "A" and i have the Data Adding it also. Now i need to remove the "A" when it is placed in the Data Sheet leaving ONLY the Numerical value. EG. "A 1234" to be "1234" how do i do that ? "Corey" wrote in message ... Thanks Tom, but i seem to STILL get ONLY the MAX value. If i do this: TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 2) then i get the MAX + 1 ???? "Tom Ogilvy" wrote in message ... try TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
So instead of
Range("A1").Value = TextBox1.Value do Range("A1").Value = Application.Max(Sheets("Data").Range("A:A")) + 1 Reminds me of the old joke Patient: Doc, it hurts when I do this! Doctor: Don't do that. But maybe I am missing something <g -- Regards, Tom Ogilvy "Corey" wrote in message ... I am using code like : Range("A1").Value = TextBox1.Value "Tom Ogilvy" wrote in message ... How are you putting the value in the cell. If by a link, do it with code instead. -- Regards, Tom Ogilvy "Corey" wrote in message ... Found out why. I was adding the "A" and i have the Data Adding it also. Now i need to remove the "A" when it is placed in the Data Sheet leaving ONLY the Numerical value. EG. "A 1234" to be "1234" how do i do that ? "Corey" wrote in message ... Thanks Tom, but i seem to STILL get ONLY the MAX value. If i do this: TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 2) then i get the MAX + 1 ???? "Tom Ogilvy" wrote in message ... try TextBox1.Value = "A " & (Application.Max(Sheets("Data").Range("A:A")) + 1) -- Regards, Tom Ogilvy "Corey" wrote in message ... TextBox1.Value = "A " & Application.Max(Sheets("Data").Range("A:A")) + 1 The result of the above is EQUAL to the MAX value and NOT (+1) Why? I get "A 3869" instead of "A3870". Corey.... |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT adding 1 ??
Dr: Please go to the window and stick your tongue out and say ahhhhhhhh.
Patient: Why? Dr. I don't like the guy across the street. Tom Ogilvy wrote: <<snipped Reminds me of the old joke Patient: Doc, it hurts when I do this! Doctor: Don't do that. But maybe I am missing something <g -- Regards, Tom Ogilvy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding | Excel Discussion (Misc queries) | |||
Adding | Excel Discussion (Misc queries) | |||
Adding every 5th row (e.g. B5 + B10 + B15 etc) | Excel Discussion (Misc queries) | |||
adding | Excel Discussion (Misc queries) | |||
Adding with & | Excel Worksheet Functions |