LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Need help with loop code

Hi

I am having probs with the following coding...

i need to copy sheet 1 to sheet 2 in the following order over any number of
rows...

sheet one =data sheet
sheet two= destination sheet

Sheet 2 - Col A =ref eg AA, auto fill down 11 rows
sheet 1 -

repeat with sheet 1
Range H2:S2 fixed range, copy and pastespecial transpose into sheet 2 col B
then H4:S4 copy and pastespecial transpose into sheet 2, col C
T4:V4 copy an paste special only across cols E,F&G, then auto fill same data
down 11 rows.


Dim row1
Dim row2
row1 = 2
row2 = 3
Do
Sheets("BIF").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = "BB"
Range("D2").Select
ActiveCell.FormulaR1C1 = "PM Budget Input 2007"
Range("B2").Select

Sheets("DATA").Select
Range("H2:S2").Select
Selection.copy
Sheets("BIF").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True

Range("C2").Select
Sheets("DATA").Select
Range("H3:S3").Select
Application.CutCopyMode = False
Selection.copy
Sheets("BIF").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True

Range("E2").Select
Sheets("DATA").Select
Range("T3:V3").Select
Selection.copy
Sheets("BIF").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A13")

Range("D2:G2").Select
Selection.AutoFill Destination:=Range("D2:G13"), Type:=xlFillCopy
Range("D2:G13").Select


row2 = 2 + 1

Loop Until ActiveCell.Value = ""

End Sub







 
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
Help with better loop code Sliman Excel Programming 1 March 16th 06 07:10 PM
Loop for VBA code? paulinoluciano Excel Worksheet Functions 5 December 28th 05 01:30 PM
Loop Code sheeba Excel Programming 0 December 4th 05 06:12 AM
How to get my code to loop Dominique Feteau[_2_] Excel Programming 5 December 17th 04 01:35 PM
Help with loop code... gaba Excel Programming 1 October 20th 04 01:37 PM


All times are GMT +1. The time now is 09:34 AM.

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"