Today’s Accomplishment At Work

Got a quick little assignment to do some calculations at work today.  The most difficult part was figuring out how to combine 17 worksheets (not workbooks) into one big excel sheet.  Did some looking around and found this great little macro. It worked like magic!  My boss was really impressed how fast I figured this out.  Once I got the macro,  some quick vlookups, a pivit table and done.  Google is my best friend.  The code is below:

Sub move_data()
Dim Sht As Worksheet
Dim Rng As Range
For Each Sht In Sheets
If Sht.Name = “Sheet4” Then
Set Rng = Sht.Range(“A2:C” & Sht.Range(“C” & Rows.Count).End(xlUp).Row)
Rng.Copy Destination:=Sheets(“Sheet4”).Range(“A” & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next Sht
With Sheets(“Sheet4”).Range(“A2:C” & Range(“C” & Rows.Count).End(xlUp).Row)
End With

End Sub

This entry was posted in work. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s