Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Range and non contiguous cells

Hi, I am trying to copy and paste some cells, Here is a piece of the macro.

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Range("Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)").Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
But in the range where ther is the multiple cells in stops.

I have the same for 12 items and the macro stops in the first.

Can anyone help me.

Thanks

Fernando
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Range and non contiguous cells

Untested but you can give this a try...

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Union(Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)).Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

--
HTH...

Jim Thomlinson


"fsmelgar" wrote:

Hi, I am trying to copy and paste some cells, Here is a piece of the macro.

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Range("Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)").Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
But in the range where ther is the multiple cells in stops.

I have the same for 12 items and the macro stops in the first.

Can anyone help me.

Thanks

Fernando

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Range and non contiguous cells

Range(Cells(i, 18)).Activate ??


"Jim Thomlinson" wrote:

Untested but you can give this a try...

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Union(Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)).Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

--
HTH...

Jim Thomlinson


"fsmelgar" wrote:

Hi, I am trying to copy and paste some cells, Here is a piece of the macro.

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Range("Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)").Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
But in the range where ther is the multiple cells in stops.

I have the same for 12 items and the macro stops in the first.

Can anyone help me.

Thanks

Fernando

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Range and non contiguous cells

Thank you both anwers were rally help full.

To JLGWhiz:

That line was wrote using the record macro so I don't know what was it, but
the macro flag an error with that line.

To Jim Thomlinson:
Using Union instead of range solve my problem, I used in all the 12 items
and it worked instantly.

Thanks to both of you

Fernando

"JLGWhiz" wrote:

Range(Cells(i, 18)).Activate ??


"Jim Thomlinson" wrote:

Untested but you can give this a try...

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Union(Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)).Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

--
HTH...

Jim Thomlinson


"fsmelgar" wrote:

Hi, I am trying to copy and paste some cells, Here is a piece of the macro.

Windows("Loans Delinquency APRIL 2007.xls").Activate
Sheets("Bank 101 Ledger 19").Select
Range("Cells(i, 2), Cells(i, 4), Cells(i, 6), Cells(i, 8), Cells(i, 10),
Cells(i, 12), Cells(i, 14), Cells(i, 16), Cells(i, 18)").Select
Range(Cells(i, 18)).Activate
Selection.Copy
Windows("2007 LOANS DELICUENCY BANK 101.xls").Activate
Sheets("APRIL").Select
Cells(y, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True
But in the range where ther is the multiple cells in stops.

I have the same for 12 items and the macro stops in the first.

Can anyone help me.

Thanks

Fernando

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
Join non-contiguous ranges into one range via named range? ker_01 Excel Discussion (Misc queries) 3 May 1st 09 11:09 AM
Add non-contiguous cells to range? Ed Excel Programming 2 March 27th 07 03:00 PM
counting cells that are 0 in a range of non-contiguous cells Mark Excel Worksheet Functions 9 March 14th 07 02:45 PM
pasting non-contiguous range of cells to new row, same cell locati Not excelling at macros New Users to Excel 3 April 4th 06 08:57 PM
Range holding non-contiguous cells William Benson[_2_] Excel Programming 24 July 27th 05 02:41 PM


All times are GMT +1. The time now is 08:55 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"