#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Macro help

Sub Macro1()
'
' Macro1 Macro
'

'
Range("P4:Q7").Select
Selection.Cut
Range("A14").Select
ActiveSheet.Paste
Range("R4:S7").Select
Selection.Cut
Range("A18").Select
ActiveSheet.Paste
End Sub

Here is a macro I am working on and I need it to continue for 98 more times
but I can't figure out the loop. Any help is appreciated. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Macro help

Try the below..

Sub Macro1()
Dim lngCol As Long, lngRow As Long, intTemp As Integer
lngCol = 14
lngRow = 10
For intTemp = 1 To 80
lngCol = lngCol + 2
lngRow = lngRow + 4
Range(Cells(4, lngCol), Cells(7, lngCol + 1)).Cut Range("A" & lngRow)
Next

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Confusicous" wrote:

Sub Macro1()
'
' Macro1 Macro
'

'
Range("P4:Q7").Select
Selection.Cut
Range("A14").Select
ActiveSheet.Paste
Range("R4:S7").Select
Selection.Cut
Range("A18").Select
ActiveSheet.Paste
End Sub

Here is a macro I am working on and I need it to continue for 98 more times
but I can't figure out the loop. Any help is appreciated. Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default Macro help

Try this:
Sub Macro1()
N=14
For i=16 to 116 step 2
Cells(4,i).resize(4,2).cut cells(N,1)
N=N+4
Next
End Sub

HTH
Bob Umlas
Excel MVP

"Confusicous" wrote in message
...
Sub Macro1()
'
' Macro1 Macro
'

'
Range("P4:Q7").Select
Selection.Cut
Range("A14").Select
ActiveSheet.Paste
Range("R4:S7").Select
Selection.Cut
Range("A18").Select
ActiveSheet.Paste
End Sub

Here is a macro I am working on and I need it to continue for 98 more
times
but I can't figure out the loop. Any help is appreciated. Thanks



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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM


All times are GMT +1. The time now is 11:06 PM.

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

About Us

"It's about Microsoft Excel"