Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Copy a range from one copy to the other

I need to copy the data from "SP" tab to the "Form 295" tab based on a
certain criteria. The criterias are if column 6 is "Y" and column 7 is
"N", then transfer to "Form 295" tab.


1 2 3 4 5 6 7
2 Tab: SP tab
3 masno cust_name ext_limit exp_dt commited UFN
4 0000158 MARIDAH BINTI DATO'IDRIS 42000 30.11.18 Y N
5 0000158 MARIDAH BINTI DATO'IDRIS 1201 30.11.18 Y N
6 0000521 LIM PANG LOONG 300000 31.08.06 N Y
7
8
9 Tab: Form295
10 masno cust_name ext_limit exp_dt commited UFN


Below is the macro that I have created but it doesn't seems to work at
all.

Sub Copy_SPtab()

Dim lastrow As Double, i As Double, j As Double

Sheets("Form295").Cells.ClearContents

lastrow = WorksheetFunction.Count(Columns(7))
i = 1
j = 1
For i = 2 To lastrow


If Cells(i, 9) = "Y" And Cells(i, 10) = "N" Then
Range(i & ":" & i).Copy Sheets("Form295").Range("A" & j)
j = j + 1
End If
Next


End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy a range from one copy to the other


without using your code i notice that in your IF THEN statement you
specify a range to copy and directly after specify a destination but no
selection or paste command.

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=572036

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Copy a range from one copy to the other

Hi,

I think there isn't any problem with the copy paste formula. I have
used the same logic for others. The logic is as below.

Range("A1:E1").copy range("A2")

Appreciate if you can assist to list down the correct formulaes.

Thank you.


Simon Lloyd wrote:
without using your code i notice that in your IF THEN statement you
specify a range to copy and directly after specify a destination but no
selection or paste command.

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=572036


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Copy a range from one copy to the other

hI JEN,

Just +1 to lastrow ... maybe helpfull for you ...

Thanks,

Halim

Jentan menuliskan:
Hi,

I think there isn't any problem with the copy paste formula. I have
used the same logic for others. The logic is as below.

Range("A1:E1").copy range("A2")

Appreciate if you can assist to list down the correct formulaes.

Thank you.


Simon Lloyd wrote:
without using your code i notice that in your IF THEN statement you
specify a range to copy and directly after specify a destination but no
selection or paste command.

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=572036


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 copy formulas but using the same range each time I copy Laffin Excel Worksheet Functions 2 June 22nd 06 04:17 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
Range COPY function - how to copy VALUES and not formulas James Cooke Excel Programming 1 August 21st 03 07:04 PM


All times are GMT +1. The time now is 03:32 PM.

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"