PC Review


Reply
Thread Tools Rate Thread

Copy from on eworkbook to another

 
 
Karen53
Guest
Posts: n/a
 
      14th Mar 2008
Hi,

I have two columns which copy to the new book rounded to the nearest dollar.
None of the other columns are doing this. It should be to 2 decimal places.

CAMDepMade is long

Sub NuSaveCAMDepMade(TenRow, CAMDepMade)

'Created 3/13/2008 by Karen Hoagland

Debug.Print "Starting NuSaveCAMDepMade " & Application.ScreenUpdating

With MainPagepg

'save CAM Deposits Made
With .Cells(TenRow, 14)
If CAMDepMade = 0 Then
.HorizontalAlignment = xlRight
.WrapText = False
.NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
""-""??_);_(@_)"
.Value = CAMDepMade
End If

If .Value <> CAMDepMade Then
.HorizontalAlignment = xlRight
.WrapText = False
.NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
""-""??_);_(@_)"
.Value = CAMDepMade
End If
End With

End With

End Sub
--
Thanks for your help.
Karen53
 
Reply With Quote
 
 
 
 
Jim Thomlinson
Guest
Posts: n/a
 
      14th Mar 2008
Without looking too closely you have declared
CAMDepMade is long
where long is a long integer. If you try to put a decimal into this variable
it will be automatically coereced to a whole number. Try changing the
delcaration to Double.
--
HTH...

Jim Thomlinson


"Karen53" wrote:

> Hi,
>
> I have two columns which copy to the new book rounded to the nearest dollar.
> None of the other columns are doing this. It should be to 2 decimal places.
>
> CAMDepMade is long
>
> Sub NuSaveCAMDepMade(TenRow, CAMDepMade)
>
> 'Created 3/13/2008 by Karen Hoagland
>
> Debug.Print "Starting NuSaveCAMDepMade " & Application.ScreenUpdating
>
> With MainPagepg
>
> 'save CAM Deposits Made
> With .Cells(TenRow, 14)
> If CAMDepMade = 0 Then
> .HorizontalAlignment = xlRight
> .WrapText = False
> .NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
> ""-""??_);_(@_)"
> .Value = CAMDepMade
> End If
>
> If .Value <> CAMDepMade Then
> .HorizontalAlignment = xlRight
> .WrapText = False
> .NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
> ""-""??_);_(@_)"
> .Value = CAMDepMade
> End If
> End With
>
> End With
>
> End Sub
> --
> Thanks for your help.
> Karen53

 
Reply With Quote
 
Karen53
Guest
Posts: n/a
 
      14th Mar 2008
Thank you, Jim
--
Thanks for your help.
Karen53


"Jim Thomlinson" wrote:

> Without looking too closely you have declared
> CAMDepMade is long
> where long is a long integer. If you try to put a decimal into this variable
> it will be automatically coereced to a whole number. Try changing the
> delcaration to Double.
> --
> HTH...
>
> Jim Thomlinson
>
>
> "Karen53" wrote:
>
> > Hi,
> >
> > I have two columns which copy to the new book rounded to the nearest dollar.
> > None of the other columns are doing this. It should be to 2 decimal places.
> >
> > CAMDepMade is long
> >
> > Sub NuSaveCAMDepMade(TenRow, CAMDepMade)
> >
> > 'Created 3/13/2008 by Karen Hoagland
> >
> > Debug.Print "Starting NuSaveCAMDepMade " & Application.ScreenUpdating
> >
> > With MainPagepg
> >
> > 'save CAM Deposits Made
> > With .Cells(TenRow, 14)
> > If CAMDepMade = 0 Then
> > .HorizontalAlignment = xlRight
> > .WrapText = False
> > .NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
> > ""-""??_);_(@_)"
> > .Value = CAMDepMade
> > End If
> >
> > If .Value <> CAMDepMade Then
> > .HorizontalAlignment = xlRight
> > .WrapText = False
> > .NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(*
> > ""-""??_);_(@_)"
> > .Value = CAMDepMade
> > End If
> > End With
> >
> > End With
> >
> > End Sub
> > --
> > Thanks for your help.
> > Karen53

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Internet Explorer 0 22nd Apr 2011 10:08 AM
http://LongPathTool.com - find and delete/copy path too long filesfrom your hard drive or LAN Windows tool to copy or delete files and folderswith path too long or filename too long error. Just browse to the file andpress a button to copy or d Martin Krag Windows XP Setup 0 22nd Apr 2011 10:06 AM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Microsoft Windows 2000 Active Directory 1 17th Feb 2009 01:31 PM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Windows Vista General Discussion 2 17th Feb 2009 01:31 PM
EXCEL FILE a copy/a copy/a copy ....filename =?Utf-8?B?dmU=?= Microsoft Excel New Users 1 29th Sep 2005 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:20 AM.