Acts 7:42

But God turned [away from them] and allowed them to worship heavenly bodies [i.e., stars], just as it was written in the prophet [Amos 5:25ff], 'Did you offer me slain animals as sacrifices for forty years in the wilderness, you Israelites?

Acts 13:18

For about forty years He tenderly cared for them in the wilderness.

Treasury of Scripture Knowledge

Summary

Also I brought you up from the land of Egypt, and led you forty years through the wilderness, to possess the land of the Amorite.

Bible References

And led

Acts 7:42
But God turned [away from them] and allowed them to worship heavenly bodies [i.e., stars], just as it was written in the prophet [Amos 5:25ff], 'Did you offer me slain animals as sacrifices for forty years in the wilderness, you Israelites?
Acts 13:18
For about forty years He tenderly cared for them in the wilderness.