The only option to avoid ferries is to drive from Hamburg into Denmark and then to Fyn, across the Store Baelt Bridge to Copenhagen and form there over the Öresunds Bridge to Malmö.
Information about the two bridges can you find here:
Unfortunately there are no ferries any longer from UK to the Nordics, but there are a number of ferries from Germany to Sweden.
Using the shortest ferry ride – Puttgarden – Rödby (A) will also mean driving across the bridge from Copenhagen to Malmö.
Öresunds Bridge https://www.oresundsbron.com/en/start
The other ferries goes directly to Sweden and there is no need for a bridge crossing.
A Scandlines Puttgarden – Rödby https://www.scandlines.com/
B Finnlines Travemünde – Malmö https://www.finnlines.com/ferry-trips
C TT Lines Travemünde – Trelleborg https://www.ttline.com/en/
D TT Lines Rostock – Trelleborg https://www.ttline.com/en/
D Stena Lines Rostock – Trelleborg https://www.stenalinetravel.com/ferry-to-scandinavia
E FRS Baltic Sassnitz - Ystad https://www.frs-baltic.com/en/ferry-germany-sweden
Map image courtesy of Google Maps, own work