Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jer jer is offline
external usenet poster
 
Posts: 25
Default resize and copy

Dear all
I am trying to get from (an existing table)

Fees Frequency DueDate LDueDate PNoPayments
$50.00 Y 9/30/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4

to

Fees Frequency DueDate LDueDate PNoPayments
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4

with

Dim cell As Range, i As Long
Dim lastrow As Long, sh1 As Worksheet
Set sh1 = ActiveWorkbook.Worksheets("Sample")
lastrow = sh1.Cells(Rows.Count, 1).End(xlUp).Row

For i = lastrow To 1 Step -1

Set cell = sh1.Cells(i, 1)

If cell.Offset(0, 4) 1 Then

cell.Resize(cell.Offset(0, 4) - 1, 1).EntireRow.Insert

cell.Resize(1, 5).Copy _
cell.Offset(1, 0).Resize(cell.Offset(0, 4) - 1, 5)

End If
Next i

but having trouble with last couple lines of the code, which I
have modified from newgroup contributors.

Any suggestions help would be greatly appreciated
--
thanks as always for the help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default resize and copy

Dim cell As Range, i As Long
Dim lastrow As Long, sh1 As Worksheet
Set sh1 = ActiveWorkbook.Worksheets("Sample")
lastrow = sh1.Cells(Rows.Count, 1).End(xlUp).Row

For i = lastrow To 1 Step -1

Set cell = sh1.Cells(i, 1)

If cell.Offset(0, 4) 1 Then

cell.Offset(1,0).Resize(cell.Offset(0, 4) - 1, 1).EntireRow.Insert

cell.Resize(1, 5).Copy _
cell.Offset(1, 0).Resize(cell.Offset(0, 4) - 1, 5)

End If
Next i

Untested, but I believe that will work.

--
Regards,
Tom Ogilvy



"jer" wrote in message
...
Dear all
I am trying to get from (an existing table)

Fees Frequency DueDate LDueDate PNoPayments
$50.00 Y 9/30/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4

to

Fees Frequency DueDate LDueDate PNoPayments
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4

with

Dim cell As Range, i As Long
Dim lastrow As Long, sh1 As Worksheet
Set sh1 = ActiveWorkbook.Worksheets("Sample")
lastrow = sh1.Cells(Rows.Count, 1).End(xlUp).Row

For i = lastrow To 1 Step -1

Set cell = sh1.Cells(i, 1)

If cell.Offset(0, 4) 1 Then

cell.Resize(cell.Offset(0, 4) - 1, 1).EntireRow.Insert

cell.Resize(1, 5).Copy _
cell.Offset(1, 0).Resize(cell.Offset(0, 4) - 1, 5)

End If
Next i

but having trouble with last couple lines of the code, which I
have modified from newgroup contributors.

Any suggestions help would be greatly appreciated
--
thanks as always for the help



  #3   Report Post  
Posted to microsoft.public.excel.programming
jer jer is offline
external usenet poster
 
Posts: 25
Default resize and copy

Tom
Thank you ... works like a charm
--
thanks as always for the help


"Tom Ogilvy" wrote:

Dim cell As Range, i As Long
Dim lastrow As Long, sh1 As Worksheet
Set sh1 = ActiveWorkbook.Worksheets("Sample")
lastrow = sh1.Cells(Rows.Count, 1).End(xlUp).Row

For i = lastrow To 1 Step -1

Set cell = sh1.Cells(i, 1)

If cell.Offset(0, 4) 1 Then

cell.Offset(1,0).Resize(cell.Offset(0, 4) - 1, 1).EntireRow.Insert

cell.Resize(1, 5).Copy _
cell.Offset(1, 0).Resize(cell.Offset(0, 4) - 1, 5)

End If
Next i

Untested, but I believe that will work.

--
Regards,
Tom Ogilvy



"jer" wrote in message
...
Dear all
I am trying to get from (an existing table)

Fees Frequency DueDate LDueDate PNoPayments
$50.00 Y 9/30/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4

to

Fees Frequency DueDate LDueDate PNoPayments
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$50.00 Y 9/30/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$150.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$200.00 Y 12/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4
$175.00 Y 1/31/2006 9/30/2011 4

with

Dim cell As Range, i As Long
Dim lastrow As Long, sh1 As Worksheet
Set sh1 = ActiveWorkbook.Worksheets("Sample")
lastrow = sh1.Cells(Rows.Count, 1).End(xlUp).Row

For i = lastrow To 1 Step -1

Set cell = sh1.Cells(i, 1)

If cell.Offset(0, 4) 1 Then

cell.Resize(cell.Offset(0, 4) - 1, 1).EntireRow.Insert

cell.Resize(1, 5).Copy _
cell.Offset(1, 0).Resize(cell.Offset(0, 4) - 1, 5)

End If
Next i

but having trouble with last couple lines of the code, which I
have modified from newgroup contributors.

Any suggestions help would be greatly appreciated
--
thanks as always for the help




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
Why Copy/Paste fails using Offset & Resize of myRange? [email protected] Excel Discussion (Misc queries) 3 November 21st 06 02:06 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
copy cell after resize method in VBA norika Excel Programming 0 June 22nd 05 05:03 AM
Resize name box Dave Peterson Setting up and Configuration of Excel 0 January 19th 05 01:01 AM


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