If my recipe requires margarine and I don't have handy, Can I substitute margarine for shortening? do they have the same function in a cake or cookie recipe?
It will probably be OK, but I think margarine may have a higher water content than shortening. It depends on the recipe as to how much difference it would make. For cookies or bars, I'm sure you would be fine.