Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MGM MGM is offline
external usenet poster
 
Posts: 3
Default commas missing at copy and past in excel

I have a macro, part of which I convert a column of figures to currency with
zero decimal places, a euro symbol and with comma for the 000s.
When I then copy these cells to another column, it puts back the 2 decimal
places and loses the commas and the euro. As the cell is now part of a
collection of cells and mixed with regular text I can't isolate it and reset
it to currency again.
How do I make it hold the currency values when I copy? I have tried
selecting the cells and copying values but it still seems to lose the stuff.

Any help would be appreciated.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default commas missing at copy and past in excel

can you post the code you use to copy, you need to make sure you're copying the
formats, too

--


Gary


"MGM" wrote in message
...
I have a macro, part of which I convert a column of figures to currency with
zero decimal places, a euro symbol and with comma for the 000s.
When I then copy these cells to another column, it puts back the 2 decimal
places and loses the commas and the euro. As the cell is now part of a
collection of cells and mixed with regular text I can't isolate it and reset
it to currency again.
How do I make it hold the currency values when I copy? I have tried
selecting the cells and copying values but it still seems to lose the stuff.

Any help would be appreciated.

Michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
MGM MGM is offline
external usenet poster
 
Posts: 3
Default commas missing at copy and past in excel

Here is the code I am using

Columns("G:G").Select
Selection.NumberFormat = "‚¬#,##0"

Columns("G:G").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=PROPER(RC[-11]&"", ""&RC[-10]&"" ""&RC[-9]&"" ""&RC[-8]&"".
‚¬""&RC[-5]&""^"")"

' Range("L1").Select
' Selection.Copy
' Selection.AutoFill Destination:=Range("L:L"), Type:=xlFillDefault


"MGM" wrote:

I have a macro, part of which I convert a column of figures to currency with
zero decimal places, a euro symbol and with comma for the 000s.
When I then copy these cells to another column, it puts back the 2 decimal
places and loses the commas and the euro. As the cell is now part of a
collection of cells and mixed with regular text I can't isolate it and reset
it to currency again.
How do I make it hold the currency values when I copy? I have tried
selecting the cells and copying values but it still seems to lose the stuff.

Any help would be appreciated.

Michael

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default commas missing at copy and past in excel

Hi Michael,

Try something like:

'=============
Public Sub Tester()
Dim LRow As Long
Const col As String = "A" '<<==== CHANGE

LRow = Cells(Rows.Count, col).End(xlUp).Row

With Range("G1:G" & LRow)
.NumberFormat = "?#,##0"
.Value = .Value
End With

With Range("L1")
.FormulaR1C1 = _
"=PROPER(RC[-11]& "", "" & RC[-10]& "" ""& RC[-9]&" & _
" "" ""& RC[-8]& "".?"" &" _
& " text(RC[-5],""0"")&""^"")"
.Copy
.AutoFill Destination:=Range("L1:L" & LRow), _
Type:=xlFillDefault
End With

End Sub
'<<=============


---
Regards,
Norman



"MGM" wrote in message
...
Here is the code I am using

Columns("G:G").Select
Selection.NumberFormat = "?#,##0"

Columns("G:G").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Range("L1").Select
ActiveCell.FormulaR1C1 = _
"=PROPER(RC[-11]&"", ""&RC[-10]&"" ""&RC[-9]&"" ""&RC[-8]&"".
?""&RC[-5]&""^"")"

' Range("L1").Select
' Selection.Copy
' Selection.AutoFill Destination:=Range("L:L"), Type:=xlFillDefault


"MGM" wrote:

I have a macro, part of which I convert a column of figures to currency
with
zero decimal places, a euro symbol and with comma for the 000s.
When I then copy these cells to another column, it puts back the 2
decimal
places and loses the commas and the euro. As the cell is now part of a
collection of cells and mixed with regular text I can't isolate it and
reset
it to currency again.
How do I make it hold the currency values when I copy? I have tried
selecting the cells and copying values but it still seems to lose the
stuff.

Any help would be appreciated.

Michael



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default commas missing at copy and past in excel

Hi Michael,

"=PROPER(RC[-11]& "", "" & RC[-10]& "" ""& RC[-9]&" & _
" "" ""& RC[-8]& "".?"" &" _
& " text(RC[-5],""0"")&""^"")"


Should read:

"=PROPER(RC[-11]& "", "" & RC[-10]& "" ""& RC[-9]&" & _
" "" ""& RC[-8]& "".?"" &" _
& " text(RC[-5],""#,##0"")&""^"")"

---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
MGM MGM is offline
external usenet poster
 
Posts: 3
Default commas missing at copy and past in excel

Norman,

Thank you very much, that worked perfectly.

Best regards

Michael

"Norman Jones" wrote:

Hi Michael,

"=PROPER(RC[-11]& "", "" & RC[-10]& "" ""& RC[-9]&" & _
" "" ""& RC[-8]& "".?"" &" _
& " text(RC[-5],""0"")&""^"")"


Should read:

"=PROPER(RC[-11]& "", "" & RC[-10]& "" ""& RC[-9]&" & _
" "" ""& RC[-8]& "".?"" &" _
& " text(RC[-5],""#,##0"")&""^"")"

---
Regards,
Norman



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
source data editor in Excel 2007 dont seem to allow copy and past. Pieter Charts and Charting in Excel 1 May 8th 08 12:35 AM
Excel and Notepad: how avoid additional inverted commas after copy ghisirds Excel Discussion (Misc queries) 0 September 10th 07 03:48 PM
cannot copy/past in Excel Vipin Excel Discussion (Misc queries) 1 September 28th 05 02:07 PM
Missing commas Steve Mock Excel Worksheet Functions 1 January 23rd 05 08:57 AM
How: Need 2 Copy sentences with commas & paste into one cell. jbaker38 Excel Programming 7 October 26th 04 01:58 AM


All times are GMT +1. The time now is 04:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"