If you roll from the character sheet, you should be able to hit the 'up' key in the chat box to see what the character sheet macro actually entered automatically for you (hitting 'up' in the chatbox refills the chatbox with the previous submission). You can copy and paste that into a custom-made macro to create a macro with the same effect, and can then check the option to put it in your macro bar.
For example, after rolling a melee weapon attack and hitting up, I see:
/em uses @{Eausreph Sliicoe|meleeweaponname1} to attack
[[1d20 + @{Eausreph Sliicoe|meleetohit1} [To Hit] + @{Eausreph Sliicoe|global_melee_attack_bonus} [Active Melee Attack Bonus] ]] | [[1d20 + @{Eausreph Sliicoe|meleetohit1} [To Hit] + @{Eausreph Sliicoe|global_melee_attack_bonus} [Active Melee Attack Bonus] ]] vs AC
When I put that in a macro, I get the same output as hitting the character sheet button.
In addition to that workaround, due to a roll20 update since the original question, you can now just drag the button onto the macro bar and it will create a macro for that roll for you.