S
stakar
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 o
the range "BH" and then using the copy paste special, copies only th
values.
What I want is , for each value to add the quote (eg '01 or '0 o
'00010 etc) because i want to change them to strings
2 specialist gave me the following codes from a different view, bu
both do exactly what i want
The problem is that they are both EXTREMELY slow because i have mor
than 1000 rows to change
code #1:
-------------------------------------------------------------------------------
Dim x As Long
Dim y As Long
y = Range("B65536").End(xlUp).Row
For x = 1 To y
Range("B" & x).Value = "'" & Range("B" & x).Value
Next x
-------------------------------------------------------------------------------
code #2:
Change
------------------------------------------
rng.Copy
rng.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
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 o
the range "BH" and then using the copy paste special, copies only th
values.
What I want is , for each value to add the quote (eg '01 or '0 o
'00010 etc) because i want to change them to strings
2 specialist gave me the following codes from a different view, bu
both do exactly what i want
The problem is that they are both EXTREMELY slow because i have mor
than 1000 rows to change
code #1:
-------------------------------------------------------------------------------
Dim x As Long
Dim y As Long
y = Range("B65536").End(xlUp).Row
For x = 1 To y
Range("B" & x).Value = "'" & Range("B" & x).Value
Next x
-------------------------------------------------------------------------------
code #2:
Change
------------------------------------------
rng.Copy
rng.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False