View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Mark Costello[_2_] Mark Costello[_2_] is offline
external usenet poster
 
Posts: 9
Default Help with using a Macro Loop

Thank you for that, although I don't want to copy and paste the values as a
range, I need to do them individually (what I'm trying to do isn't as simple
as my example, unfortunately)

"Mike H" wrote:

Mark,

This copies the used range of row 1 sheet 1 to row 1 sheet 2

Right click the sheet tab with your data in, view code and paste this in:-

Sub stantial()
Dim MyRange As Range
Set MyRange = Range("A1:" & Range("IV1").End(xlToLeft).Address)
MyRange.Copy
Sheets("Sheet2").Range("A1").Select
ActiveSheet.Paste
End Sub

Mike

"Mark Costello" wrote:

Hello,

could someone help me with using a macro?

I need to use a macro to work along the columns of a spreadsheet (i.e.
select cell A1, copy, paste in another spreadsheet's A1, then select cell B1
and if not blank, copy and paste in the other spreadsheet's B1 and so on).

I will be using nearly all the columns in the spreadsheet so it's not
feasable to just type in the cells in the macro, hence the need for a loop.

Any help would be appreciated!!


Thanks