Tips to create custom tabs for
SharePoint 2013 and 2010 ribbons
SharePoint Ribbon tips
Activating a SharePoint ribbon tab when the web page is loaded
As you probably know, you cannot use the .NET code similar to below in sandboxed solutions:
The code above doesn't work very well in farm solutions, either: the tab gets selected but it doesn't get activated. The script below allows you to bypass this limitation and activate the tab in both sandboxed and farm solutions.
Showing a custom Ribbon tab for a given SharePoint list
Add a Ribbon tab component onto the designer surface and set the IdMsp property to List. Now you need to set the ItemType property to the ID of the list. To find out the ID, open Microsoft SharePoint Designer and navigate to your list:
Specifying the List ID (it's selected in the screenshot above) in the ItemTypes property of the Ribbon Tab component guarantees that the tab will be shown for that list only.