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: 8
Default Macro Help

Hi I need a macro but I really dont know what I am doing. I have a
spreadsheet with (sheet 1) data in columns A & B, Column A has a date and
time starting with mid-night and going up in half-hour increments, so 48 for
each day, Column B has data for each half-hour. I need to copy and paste each
day at a time (onto sheet 2) and transpose it so that I have a Date in A1,
half-hour 1 in A2, half-hour 2 in A3 etc. I can get it to do this but then
when i run my macro repeatedly it copies day 2 over day 1 etc.

Can anyone help me get the code right so that is choses the next available
row (sheet 2) to paste into and loop until there are no more days left (Sheet
1). The number of days will vary from month to month and I also may need this
quarterly so no upper bound on the loop if possible.

I kinda get the concept I just dont have enough experience to do this
myself, below is what I have managed through the "Record Macro" function in
excel.


Sub Data_Transpose()
'
' Data_Transpose Macro
'

'
Sheets("Sheet1").Select
Range("A1").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B1:B48").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Sheets("Sheet1").Select
ActiveWindow.SmallScroll Down:=24
Range("A1:B48").Select
Range("B48").Activate
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Sheets("Sheet2").Select
Range("A2").Select
Columns("A:A").EntireColumn.AutoFit
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


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