Transpose Columns to rows vba help

ijaraptor

New Member
Joined
Jan 8, 2010
Messages
14
Hello.

I have a particular sheet named "historical" (without quotes).

It contains Data in Cells A1:A5 - I have a macro running that auto populates cells A1-A5 and then in five minutes it goes to the next column and creates data in B1:B5 and so on. This runs for a week week and I start new every week.

I need to get some vba code that will automatically transpose the data that was in !Historical A1:A5 to Cells B1:B5 in the !Export Sheet and down the line.

Please help.
 
Subscript out of range when running that macro.
That means I spelled one, or both, of the sheet names differently from the way you spelled them on the tab... correct the spelling (that includes any spaces you might have tacked on the beginning or end of the name on the tab) and the code should then work.
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
That means I spelled one, or both, of the sheet names differently from the way you spelled them on the tab... correct the spelling (that includes any spaces you might have tacked on the beginning or end of the name on the tab) and the code should then work.

Awesome. That worked great. Thank you so much
 
Upvote 0
Thanks for the clarity in your last post...

Here is the code to do what you need:

Code:
Sub ValueStore()
Dim dTime As Date
Dim i As Long
    Sheets("LoadData").Range("A1:A5").Copy
    If Sheets("Historical").Cells(1, 1) = "" Then
        Sheets("Historical").Cells(1, 1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
    Else
        i = Sheets("Historical").Cells(Rows.Count, 1).End(xlUp).Row + 1
        Sheets("Historical").Cells(i, 1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
    End If
    Call StartTimer
End Sub


Sub StartTimer()
    dTime = Now + TimeValue("00:05:00")
    Application.OnTime dTime, "ValueStore", Schedule:=True
End Sub


Sub StopTimer()
    On Error Resume Next
    Application.OnTime dTime, "ValueStore", Schedule:=False
End Sub

Oops.... I didn't see this thread had a page two and that Rick had long time ago resolved this!! Sorry Rick.
I'll leave the code up anyways for anyone who can use it :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,657
Messages
6,126,065
Members
449,286
Latest member
Lantern

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top