Trying to loop format on excel

M

Melinton Teni

SO I made this macro. Im trying to format my data so I can put it in a data base. The problem is that after this first part is formatted, I really dont know how to get it to do it to the whole excel sheet. I would do it manually but the sheet has 74000 rows.. help please :(

Sub Macro1()
'
' Macro1 Macro
'

'
Range("C4:D4").Select 'Move time stamp
Selection.Cut Destination:=Range("A5:B5")
Rows("4:4").Select 'Delete time stamp row
Selection.Delete Shift:=xlUp

Range("C5:AD5").Select 'Copy and paste row to main row
Selection.Copy
Range("AE4").Select
ActiveSheet.Paste

Range("C6:AD6").Select 'Copy and paste row 3
Application.CutCopyMode = False
Selection.Copy
Range("BG4").Select
ActiveSheet.Paste

Range("C7:AD7").Select 'Copy and paste row 3
Application.CutCopyMode = False
Selection.Copy
Range("CI4").Select
ActiveSheet.Paste


Range("C8:AD8").Select 'Copy and paste row 4
Application.CutCopyMode = False
Selection.Copy
Range("DK4").Select
ActiveSheet.Paste


Range("C9:AD9").Select 'Copy and paste row 5
Application.CutCopyMode = False
Selection.Copy
Range("EM4").Select
ActiveSheet.Paste


Range("C10:AD10").Select 'Copy and paste row 6
Application.CutCopyMode = False
Selection.Copy
Range("FO4").Select
ActiveSheet.Paste


Rows("5:10").Select 'Delete rows that are left
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp





End Sub
 
I

isabelle

hi Melinton Teni,

there are only 16,384 columns in excel 2007 +, it's to bad for 74,000 rows

--
isabelle



Le 2012-06-04 12:40, Melinton Teni a écrit :
SO I made this macro. Im trying to format my data so I can put it in a data base. The problem is that after this first part is formatted,

I really dont know how to get it to do it to the whole excel sheet. I would do it manually but the sheet has 74000 rows.. help please :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top