LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default FAO VBA Code MVP's!

Hello,

I found and borrowed this macro from Dave Peterson. It works, but i need to
add in a couple of things to make my life that one bit easier.

I need to run this over a number of sheets so need the code to do that, and
call the new sheets "Sheet Name" Reform.

Also, I have a date in B2 (that chages as you go down the rows) that has to
go next to each of the indivdual time in the column.

So i need ;
B C D E......AA
14-Oct 01:23 06:21 06:58

To turn into (in a new sheet)
A B
14-Oct 01:23
14-Oct 06:21
14-Oct 06:58

This code puts the times in the order i need but just in column A, and i
need to include the dates.

I need some VBA hlep.

Thanks in advance

Sub rowstocol()

Dim wks As Worksheet
Dim colnos As Long
Dim CopytoSheet As Worksheet

If ActiveSheet.Name = "A2" Then
MsgBox "Active Sheet Not Valid" & Chr(13) _
& "Try Another Worksheet."
Exit Sub
Else
Set wks = ActiveSheet
Application.ScreenUpdating = False
For Each Wksht In Worksheets
With Wksht
If .Name = "A2" Then
Application.DisplayAlerts = False
Sheets("A2").Delete
End If
End With
Next
Application.DisplayAlerts = True
Set CopytoSheet = Worksheets.Add
CopytoSheet.Name = "A2"
wks.Activate
Range("C1").Select
colnos = InputBox("Enter Number of Columns to Transpose to Rows")

Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
With ActiveCell
.Resize(1, colnos).Copy
End With
Sheets("A2").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, _
SkipBlanks:=False _
, Transpose:=True
Application.CutCopyMode = False
ActiveSheet.Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
ActiveCell.Offset(1, 0).Select 'note: changed from 2 to 1
' Selection.EntireRow.Insert 'note: I have remmed out this line
wks.Activate
ActiveCell.Select
Loop


Sheets("A2").Activate
End If
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
to the MVP's: a Big Thank You Meenie Excel Discussion (Misc queries) 1 February 13th 09 05:20 PM
MVP's T. Valko Excel Discussion (Misc queries) 6 January 5th 07 11:26 PM
MVP's, please help me understand SUMPRODUCT. Epinn New Users to Excel 15 September 8th 06 09:03 AM
All MVP's, Try this one bondo Excel Discussion (Misc queries) 2 February 8th 06 03:56 AM
MVP's Biff Excel Discussion (Misc queries) 5 September 29th 05 05:55 AM


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