Re: Help me Changing the value to string using quote!!
From: Bernie Deitrick (_at_)
Date: 03/18/04
- Next message: Steve: "Re: Formatting Cell Based on Text in Column Beside It - Round 2"
- Previous message: Rob Bovey: "Re: Excel References"
- In reply to: stakar: "Help me Changing the value to string using quote!!"
- Next in thread: stakar: "Re: Help me Changing the value to string using quote!!"
- Reply: stakar: "Re: Help me Changing the value to string using quote!!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Mar 2004 09:29:46 -0500
Stathis,
Change
rng.Copy
rng.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
to
Dim myCell As Range
For Each myCell In rng
myCell.Value = "'" & myCell.Value
Next myCell
HTH,
Bernie
MS Excel MVP
"stakar >" <<stakar.13beyo@excelforum-nospam.com> wrote in message
news:stakar.13beyo@excelforum-nospam.com...
> I have the following code
>
> Code:
> --------------------
>
> Set rng = Range([BH4], [A65536].End(xlUp)(1, 60))
> Set checkboxrange = [A1:BG1].SpecialCells(xlCellTypeConstants, 2)
>
> For Each ThisCell In checkboxrange
> s = s & "&" & ThisCell(4).Address(False, False)
> Next ThisCell
>
> 'Turn off screen
> Application.ScreenUpdating = False
>
> rng.ClearContents
> [BH4] = "=" & Mid(s, 2, Len(s) - 1)
> [BH4].Copy rng
> rng.Copy
> rng.PasteSpecial Paste:=xlPasteValues
> Application.CutCopyMode = False
>
> --------------------
>
>
> The above code concatenate checked cells and copy them till the end of
> the range "BH" and then using the copy paste special, copies only the
> values.
> What I want is , for each value to add the quote (eg '01 or '0 or
> '00010 etc) because i want to change them to strings
>
> I found this:
> Range("BH4").Value = "'" & CStr([BH4])
> -----------------------------------------------
> But i cant do anything more!
> If its possible the code not to work cell by cell because the range of
> rows is huge and it will become very slow
>
> Thanks in advance!!
> *********************************
> Stathis
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>
- Next message: Steve: "Re: Formatting Cell Based on Text in Column Beside It - Round 2"
- Previous message: Rob Bovey: "Re: Excel References"
- In reply to: stakar: "Help me Changing the value to string using quote!!"
- Next in thread: stakar: "Re: Help me Changing the value to string using quote!!"
- Reply: stakar: "Re: Help me Changing the value to string using quote!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|