Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Paste Special--what is this doing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JPS@bebe - 22 Mar 2006 22:10 GMT
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Range("R2").Select
Application.CutCopyMode = False
Selection.Copy
Range("G2:G3500").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("l2:l3500").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("M2:M3500").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Range("M2:M3500").Select
Selection.NumberFormat = "m/d;@"
Range("F1:M1").Select
Range("M1").Activate
Application.CutCopyMode = False
Range("A1:M3500").Sort Key1:=Range("G2"), Order1:=xlDescending
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("N2").Select
Application.ScreenUpdating = True
End Sub

It looks to my like it is copying what is in R2 and pasting it in th
range G2:G3500.  But R2 contains the digit 1 and nothing else and afte
this runs
G2:G3500 does not contain 1.

I inherited this from somebody no longer here and the users are no
able to help.

Thanks
JP

--
JPS@beb
Don Guillett - 22 Mar 2006 22:27 GMT
Despite the fact that it is crudely done from a recording of the macro, the
intent is to take the number 1 and use it to multiply by the referenced
cells to force them from text to numbers.

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

>
> Private Sub CommandButton1_Click()
[quoted text clipped - 35 lines]
> Thanks
> JPS
Gary Keramidas - 22 Mar 2006 22:31 GMT
i think it's changing text to a number

see if this is more readable and fucntions the same, untested.

Option Explicit
Private Sub CommandButton1_Click()
Dim rng As Range
Application.ScreenUpdating = False

Set rng = Range("R2")
rng.Copy

With rng
Range("G2:G3500").PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End With

With rng
Range("l2:l3500").PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End With

With rng
Range("M2:M3500").PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
End With

Range("M2:M3500").NumberFormat = "m/d;@"
Range("F1:M1").Select
Range("M1").Activate

Application.CutCopyMode = False

With Range("A1:M3500")
.Sort Key1:=Range("G2"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With

Range("N2").Select
Application.ScreenUpdating = True
End Sub

Signature

Gary

> Despite the fact that it is crudely done from a recording of the macro, the
> intent is to take the number 1 and use it to multiply by the referenced cells
[quoted text clipped - 38 lines]
>> Thanks
>> JPS
Don Guillett - 22 Mar 2006 22:48 GMT
Actually, you should be able to combine the ranges

Range("G2:G3500,l2:l3500,etc").PasteSpecial Paste
Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

>i think it's changing text to a number
>
[quoted text clipped - 81 lines]
>>> Thanks
>>> JPS
Gary Keramidas - 22 Mar 2006 22:57 GMT
thanks for pointing that out, don't know how my post ended up as a reply to
yours instead of the op's

Signature

Gary

> Actually, you should be able to combine the ranges
>
[quoted text clipped - 84 lines]
>>>> Thanks
>>>> JPS
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.