concatenation

  • Thread starter Thread starter monika
  • Start date Start date
M

monika

I want something like this to appear in my cell:
=N5 & "/" & O5 & "/" & P5

I am using my code as:
Cells(tmp.Row + 1, lastColVol + 5).Value = "=(" & Cells
(tmp.Row + 1, lastColVol + 2).Address(0, 1) & " & " & "/"
& Cells(tmp.Row + 1, lastColVol + 3).Address(0, 1) & " & "
& "/" & Cells(tmp.Row + 1, lastColVol + 4).Address(0, 1)
& ")"

but this is jsut nto working :-(

any suggestion
thanks
 
Hi
first you have to use the formula property and not the value property
of your cell
Try the following (not fully tested):
Cells(tmp.Row + 1, lastColVol + 5).formula = "=" & Cells
(tmp.Row + 1, lastColVol + 2).Address(0, 1) & " & " & ""/""
& Cells(tmp.Row + 1, lastColVol + 3).Address(0, 1) & " & "
& ""/"" & Cells(tmp.Row + 1, lastColVol + 4).Address(0, 1)
 
Hi Frank

thanks for hte response

...i tried, still its giving error. i already tried this
combination mentioned. infact i tried a lot many
permutation combination. its giving type mismatch :-(
nothign is working !
reg
monika
 
Hi Monika

try
Cells(tmp.Row + 1, lastColVol + 5).formula = _
"=" & Cells(tmp.row + 1, lastcolVol + 2).Address(0, 1) & _
" & " & Chr(34) & "/" & Chr(34) & " & " & Cells(tmp.row + 1, lastcolVol
+ 3).Address(0, 1) _
& " & " & Chr(34) & "/" & Chr(34) & " & " & Cells(tmp.row + 1,
lastcolVol + 4).Address(0, 1)

Note: watch for linewraps
 
Hey Frank ..its works superbly. Was wondering what this char(34) means.and
why was it giving a problem before

anyways thanks a lot
Monika
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top