Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default PASTESPECIAL THE COPIED DATA IN " With Sheet " STATEMENT

Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & FULRNG).Copy SHEET("RESULT").RANGE("B11").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub

I want to copy but I want copied data to be pastespecial on
destination cell. I have tried above code but I am getting error. I
want to do it by using "With Sheets("F")" statement. Is there way I
can copy the way I am doing in above code but data should be
pastespecial. any help will be very useful. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default PASTESPECIAL THE COPIED DATA IN " With Sheet " STATEMENT

Hi Kamranr

Try:

'==========
Public Sub TAKEDATA()
Dim FULRNG As Long

With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
End With
End Sub
'<<==========



---
Regards.
Norman


"K" wrote in message
...
Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & FULRNG).Copy SHEET("RESULT").RANGE("B11").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub

I want to copy but I want copied data to be pastespecial on
destination cell. I have tried above code but I am getting error. I
want to do it by using "With Sheets("F")" statement. Is there way I
can copy the way I am doing in above code but data should be
pastespecial. any help will be very useful. Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default PASTESPECIAL THE COPIED DATA IN " With Sheet " STATEMENT

Here are the thing I corrected

1) sheets was missing an S
2) You can't have copy and pastespecial in the same instruction. Has to be
two instructions
3) .Range was missing a period in the front
4) In the Pastespecial you don't need to include the options that are false

Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues
End With
End Sub

"K" wrote:

Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & FULRNG).Copy SHEET("RESULT").RANGE("B11").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub

I want to copy but I want copied data to be pastespecial on
destination cell. I have tried above code but I am getting error. I
want to do it by using "With Sheets("F")" statement. Is there way I
can copy the way I am doing in above code but data should be
pastespecial. any help will be very useful. Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default PASTESPECIAL THE COPIED DATA IN " With Sheet " STATEMENT

On 13 May, 10:16, Joel wrote:
Here are the thing I corrected

1) sheets was missing an S
2) You can't have copy and pastespecial in the same instruction. *Has to be
two instructions
3) .Range was missing a period in the front
4) In the Pastespecial you don't need to include the options that are false

Sub TAKEDATA()
With Sheets("F")
* *FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
* *.Range("A2:A" & FULRNG).Copy
* *Sheets("RESULT").Range("B11").PasteSpecial _
* * * Paste:=xlPasteValues
End With
End Sub



"K" wrote:
Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & FULRNG).Copy SHEET("RESULT").RANGE("B11").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub


I want to copy but I want copied data to be pastespecial on
destination cell. *I have tried above code but I am getting error. I
want to do it by using "With Sheets("F")" statement. *Is there way I
can copy the way I am doing in above code but data should be
pastespecial. *any help will be very useful. *Thanks- Hide quoted text -


- Show quoted text -


Thanks for replying. I already know the way you told me as i tried it
before posting my question. The problem is that when i run this macro
the one you showed in your answer i can see macro going to
Sheet("RESULT") and pasting data and come back to orginal sheet of
where i click the button to run the macro. I thought if i use " With
Sheets("F") " statement instead of " Sheets("F").select " then i'll
not see macro runing around the sheets to do its job. I do want macro
to do job but it should not show that it doing it's job. For example
if i put this line in my macro
.Range("A2:A" & FULRNG).Copy SHEETS("RESULT").RANGE("B11")
then i will not see that macro gone to SHEETS("RESULT") to paste the
data and came back but if i put this line
.Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues
then i can see macro gone to SHEETS("RESULT") to paste the data and
then orginal sheet been activated all though it happes very quick but
i dont want macro to do that way. all i am trying to do is copy data
from sheet F to sheet RESULT but macro should not show visibly that it
has done its job. i hope that i was able to explain what i am trying
to do. Please if you have any suggestions.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default PASTESPECIAL THE COPIED DATA IN " With Sheet " STATEMENT

Hi K,

Try the following version:

'==========
Public Sub TAKEDATA()
Dim srcRng As Range
Dim destRng As Range
Dim irow As Long

With Sheets("F")
irow = .Range("A" & Rows.Count).End(xlUp).Row
Set srcRng = .Range("A2:A" & irow)
With srcRng
Set destRng = Sheets("RESULT").Range("B11"). _
Resize(.Rows.Count, .Columns.Count)
End With
End With

destRng.Value = srcRng.Value

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



---
Regards.
Norman


"K" wrote in message
...
On 13 May, 10:16, Joel wrote:
Here are the thing I corrected

1) sheets was missing an S
2) You can't have copy and pastespecial in the same instruction. Has to be
two instructions
3) .Range was missing a period in the front
4) In the Pastespecial you don't need to include the options that are
false

Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues
End With
End Sub



"K" wrote:
Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & FULRNG).Copy SHEET("RESULT").RANGE("B11").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub


I want to copy but I want copied data to be pastespecial on
destination cell. I have tried above code but I am getting error. I
want to do it by using "With Sheets("F")" statement. Is there way I
can copy the way I am doing in above code but data should be
pastespecial. any help will be very useful. Thanks- Hide quoted text -


- Show quoted text -


Thanks for replying. I already know the way you told me as i tried it
before posting my question. The problem is that when i run this macro
the one you showed in your answer i can see macro going to
Sheet("RESULT") and pasting data and come back to orginal sheet of
where i click the button to run the macro. I thought if i use " With
Sheets("F") " statement instead of " Sheets("F").select " then i'll
not see macro runing around the sheets to do its job. I do want macro
to do job but it should not show that it doing it's job. For example
if i put this line in my macro
..Range("A2:A" & FULRNG).Copy SHEETS("RESULT").RANGE("B11")
then i will not see that macro gone to SHEETS("RESULT") to paste the
data and came back but if i put this line
..Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues
then i can see macro gone to SHEETS("RESULT") to paste the data and
then orginal sheet been activated all though it happes very quick but
i dont want macro to do that way. all i am trying to do is copy data
from sheet F to sheet RESULT but macro should not show visibly that it
has done its job. i hope that i was able to explain what i am trying
to do. Please if you have any suggestions.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default PASTESPECIAL THE COPIED DATA IN " With Sheet " STATEMENT

On 13 May, 23:56, "Norman Jones"
wrote:
Hi K,

Try the following version:

'==========
Public Sub TAKEDATA()
* * Dim srcRng As Range
* * Dim destRng As Range
* * Dim irow As Long

* * With Sheets("F")
* * * * irow = .Range("A" & Rows.Count).End(xlUp).Row
* * * * Set srcRng = .Range("A2:A" & irow)
* * * * With srcRng
* * * * * * Set destRng = Sheets("RESULT").Range("B11"). _
* * * * * * * * * * * * * Resize(.Rows.Count, .Columns.Count)
* * * * End With
* * End With

* * * *destRng.Value = srcRng.Value

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

---
Regards.
Norman

"K" wrote in message

...
On 13 May, 10:16, Joel wrote:





Here are the thing I corrected


1) sheets was missing an S
2) You can't have copy and pastespecial in the same instruction. Has to be
two instructions
3) .Range was missing a period in the front
4) In the Pastespecial you don't need to include the options that are
false


Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues
End With
End Sub


"K" wrote:
Sub TAKEDATA()
With Sheets("F")
FULRNG = .Range("A" & Rows.Count).End(xlUp).Row
Range("A2:A" & FULRNG).Copy SHEET("RESULT").RANGE("B11").PasteSpecial
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub


I want to copy but I want copied data to be pastespecial on
destination cell. I have tried above code but I am getting error. I
want to do it by using "With Sheets("F")" statement. Is there way I
can copy the way I am doing in above code but data should be
pastespecial. any help will be very useful. Thanks- Hide quoted text -


- Show quoted text -


Thanks for replying. *I already know the way you told me as i tried it
before posting my question. *The problem is that when i run this macro
the one you showed in your answer i can see macro going to
Sheet("RESULT") and pasting data and come back to orginal sheet of
where i click the button to run the macro. *I thought if i use " With
Sheets("F") " statement instead of " Sheets("F").select " then i'll
not see macro runing around the sheets to do its job. *I do want macro
to do job but it should not show that it doing it's job. *For example
if i put this line in my macro
.Range("A2:A" & FULRNG).Copy SHEETS("RESULT").RANGE("B11")
then i will not see that macro gone to SHEETS("RESULT") to paste the
data and came back but *if i put this line
.Range("A2:A" & FULRNG).Copy
Sheets("RESULT").Range("B11").PasteSpecial _
Paste:=xlPasteValues
then i can see macro gone to SHEETS("RESULT") to paste the data and
then orginal sheet been activated all though it happes very quick but
i dont want macro to do that way. *all i am trying to do is copy data
from sheet F to sheet RESULT but macro should not show visibly that it
has done its job. *i hope that i was able to explain what i am trying
to do. *Please if you have any suggestions.- Hide quoted text -

- Show quoted text -


Thanks Norman Jones , Thats the code i wanted
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
How do I "insert copied cells"? used to be "alt i e" still work Inserter Excel Worksheet Functions 1 February 14th 09 10:06 PM
vba constant value for "Unicode Text" in PasteSpecial function Bourgui Excel Worksheet Functions 0 September 5th 08 08:32 PM
find "Cancellation" in column "A" and copy all data from Columns B-F onto another Sheet bjohnson Excel Programming 1 September 20th 07 04:02 PM
Please add a "sheet" function like "row" and "column" functions Spreadsheet Monkey Excel Programming 2 November 8th 05 04:08 PM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


All times are GMT +1. The time now is 06:28 AM.

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

About Us

"It's about Microsoft Excel"