Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default The syntax for programmatically inserting a "/" in the middle of a concatenated cell

Hello--Does anyone know the syntax for programatically inserting a "/"
between the two added numbers of a concatenated cell? I want the value
of, say, Range("a1") to equal the value of range ("a2") "/" range
("a3"). What is the syntax for telling excel to insert the slash?
A stripped down version of my code looks like this :


Sub Concat()
Range("a1").Formula = "=Value(A2&A3)"
End Sub

I want the "/" between A2 and A3.

Does anyone know the syntax?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default The syntax for programmatically inserting a "/" in the middle of a concatenated cell

[a1] = [a2] & "/" & [a3]

Note there is a space before and after the &. Of course, you could use
the Range("A1") notation instead of [a1] if you prefer. James

wrote:
Hello--Does anyone know the syntax for programatically inserting a "/"
between the two added numbers of a concatenated cell? I want the value
of, say, Range("a1") to equal the value of range ("a2") "/" range
("a3"). What is the syntax for telling excel to insert the slash?
A stripped down version of my code looks like this :


Sub Concat()
Range("a1").Formula = "=Value(A2&A3)"
End Sub

I want the "/" between A2 and A3.

Does anyone know the syntax?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default The syntax for programmatically inserting a "/" in the middle of a concatenated cell

Hey--Thanks for the help guys. The syntax you gave works for inserting
characters like 'a' in between the values, but for some reason it is
still dividing when I try to insert the /. Any ideas about what is
going on?

My code, exactly:

Sub test()

[a1] = [a11] & "/" & [a9]

End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default The syntax for programmatically inserting a "/" in the middle of a concatenated cell

The code works fine for me. I cannot see how the two numbers are being
divided unless A1 begins with =. Check A1 and make sure it doesn't
begin with =. Then post back. Maybe Don has an idea. James

wrote:
Hey--Thanks for the help guys. The syntax you gave works for inserting
characters like 'a' in between the values, but for some reason it is
still dividing when I try to insert the /. Any ideas about what is
going on?

My code, exactly:

Sub test()

[a1] = [a11] & "/" & [a9]

End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default The syntax for programmatically inserting a "/" in the middle of a concatenated cell

Sub insertslash()
With Range("A1")
..NumberFormat = "# ?/?"
..Value = Range("a2") & "/" & Range("b2")
End With
End Sub

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
Hey--Thanks for the help guys. The syntax you gave works for inserting
characters like 'a' in between the values, but for some reason it is
still dividing when I try to insert the /. Any ideas about what is
going on?

My code, exactly:

Sub test()

[a1] = [a11] & "/" & [a9]

End Sub



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default The syntax for programmatically inserting a "/" in the middle of a concatenated cell

The trouble was that the cells were in a custom format. I changed the
format to text ("@") and the problem went away. Thanks for all the
help! -Abe


Don Guillett wrote:
Sub insertslash()
With Range("A1")
.NumberFormat = "# ?/?"
.Value = Range("a2") & "/" & Range("b2")
End With
End Sub

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
Hey--Thanks for the help guys. The syntax you gave works for inserting
characters like 'a' in between the values, but for some reason it is
still dividing when I try to insert the /. Any ideas about what is
going on?

My code, exactly:

Sub test()

[a1] = [a11] & "/" & [a9]

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
correct syntax for nesting "if", "and", and "vlookup"....if possib Christine Excel Worksheet Functions 4 January 2nd 09 10:43 PM
Chg 1 "Last, First Mid" column to 3 "First", "Middle", "Last" colu JBird11002 Excel Discussion (Misc queries) 4 August 15th 08 06:31 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
whyis "paste spl" copying concatenated cell changing lastdigit2 0 robin Excel Worksheet Functions 1 December 5th 06 05:49 PM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM


All times are GMT +1. The time now is 09:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"