ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with this (https://www.excelbanter.com/excel-programming/371905-help.html)

Chris

Help with this
 
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks


Bob Umlas

Help with this
 
Range("A1","A2") doesn't have a value. It's equivalent to Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell with the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? - just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks




Chris

Help with this
 
How can I lop the range?

"Bob Umlas" wrote:

Range("A1","A2") doesn't have a value. It's equivalent to Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell with the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? - just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks





Bob Phillips

Help with this
 
For Each cell In Range("B1:B2")
cell.Value = Chr(34) & cell.Offset(0, -1) & """"
Next cell


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Chris" wrote in message
...
How can I lop the range?

"Bob Umlas" wrote:

Range("A1","A2") doesn't have a value. It's equivalent to Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell with

the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? - just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value &

""""

End Sub

Type mismatch. I am trying to take all data in one column and apply

double
quotes and put it in a second column.

Thanks







Dave Peterson

Help with this
 
Option Explicit
Sub test()
dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("b1:B2")
end with

for each mycell in myrng.cells
mycell.value = chr(34) & mycell.value & chr(34)
next mycell

End Sub

Chris wrote:

Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks


--

Dave Peterson

Bob Umlas

Help with this
 
You understood "lop the range"?


"Bob Phillips" wrote in message
...
For Each cell In Range("B1:B2")
cell.Value = Chr(34) & cell.Offset(0, -1) & """"
Next cell


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Chris" wrote in message
...
How can I lop the range?

"Bob Umlas" wrote:

Range("A1","A2") doesn't have a value. It's equivalent to

Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell

with
the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? -

just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value &

""""

End Sub

Type mismatch. I am trying to take all data in one column and apply

double
quotes and put it in a second column.

Thanks









Bob Phillips

Help with this
 
I took a punt.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bob Umlas" wrote in message
...
You understood "lop the range"?


"Bob Phillips" wrote in message
...
For Each cell In Range("B1:B2")
cell.Value = Chr(34) & cell.Offset(0, -1) & """"
Next cell


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Chris" wrote in message
...
How can I lop the range?

"Bob Umlas" wrote:

Range("A1","A2") doesn't have a value. It's equivalent to

Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell

C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell

with
the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? -

just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value

&
""""

End Sub

Type mismatch. I am trying to take all data in one column and

apply
double
quotes and put it in a second column.

Thanks











Dave Peterson

Help with this
 
Or should you have written:

I tok a punt.



Bob Phillips wrote:

I took a punt.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bob Umlas" wrote in message
...
You understood "lop the range"?


"Bob Phillips" wrote in message
...
For Each cell In Range("B1:B2")
cell.Value = Chr(34) & cell.Offset(0, -1) & """"
Next cell


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Chris" wrote in message
...
How can I lop the range?

"Bob Umlas" wrote:

Range("A1","A2") doesn't have a value. It's equivalent to

Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell

C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell

with
the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? -

just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value

&
""""

End Sub

Type mismatch. I am trying to take all data in one column and

apply
double
quotes and put it in a second column.

Thanks









--

Dave Peterson

Jim Thomlinson

Help with this
 
You need to hang around here a bit more. We all understand typo. Heck I am so
fluent that I even speak it on occasion...
--
HTH...

Jim Thomlinson


"Bob Umlas" wrote:

You understood "lop the range"?


"Bob Phillips" wrote in message
...
For Each cell In Range("B1:B2")
cell.Value = Chr(34) & cell.Offset(0, -1) & """"
Next cell


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Chris" wrote in message
...
How can I lop the range?

"Bob Umlas" wrote:

Range("A1","A2") doesn't have a value. It's equivalent to

Range("A1:A2")
which also doesn't have a value. Try entering this formula in cell C5:
=A1:A2
You get #VALUE!
You need to loop through the ranges & surround each individual cell

with
the
quotes.
Also - why did you use Chr(34) in one case and """" in the other? -

just
curious.

"Chris" wrote in message
...
Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value &

""""

End Sub

Type mismatch. I am trying to take all data in one column and apply

double
quotes and put it in a second column.

Thanks










Chris

Help with this
 
Thanks.

"Dave Peterson" wrote:

Option Explicit
Sub test()
dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("b1:B2")
end with

for each mycell in myrng.cells
mycell.value = chr(34) & mycell.value & chr(34)
next mycell

End Sub

Chris wrote:

Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks


--

Dave Peterson


Chris

Help with this
 
Your code is pretty clan too.

"Dave Peterson" wrote:

Option Explicit
Sub test()
dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("b1:B2")
end with

for each mycell in myrng.cells
mycell.value = chr(34) & mycell.value & chr(34)
next mycell

End Sub

Chris wrote:

Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks


--

Dave Peterson


Dave Peterson

Help with this
 
I don't think you like vowels! <vbg.

Chris wrote:

Your code is pretty clan too.

"Dave Peterson" wrote:

Option Explicit
Sub test()
dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("b1:B2")
end with

for each mycell in myrng.cells
mycell.value = chr(34) & mycell.value & chr(34)
next mycell

End Sub

Chris wrote:

Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value & """"

End Sub

Type mismatch. I am trying to take all data in one column and apply double
quotes and put it in a second column.

Thanks


--

Dave Peterson


--

Dave Peterson

Bob Phillips

Help with this
 
He like some.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dave Peterson" wrote in message
...
I don't think you like vowels! <vbg.

Chris wrote:

Your code is pretty clan too.

"Dave Peterson" wrote:

Option Explicit
Sub test()
dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("b1:B2")
end with

for each mycell in myrng.cells
mycell.value = chr(34) & mycell.value & chr(34)
next mycell

End Sub

Chris wrote:

Hi,
Why do I get the error with this

Sub test()

Range("B1", "B2").Value = Chr(34) & Range("A1", "A2").Value &

""""

End Sub

Type mismatch. I am trying to take all data in one column and apply

double
quotes and put it in a second column.

Thanks

--

Dave Peterson


--

Dave Peterson





All times are GMT +1. The time now is 04:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com