Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default 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








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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










  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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









  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default 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



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default 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

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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



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



All times are GMT +1. The time now is 07:27 AM.

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"