Publish a sheet to the web in Google Sheets
Create a published-view URL in B2. Enter exactly =REGEXREPLACE(A2,"/edit.*$","/pubhtml"). Do not change the spreadsheet URL in A2.
Verified by JosephineAbout 60 secondsCreate a published-view URL in B2. Enter exactly =REGEXREPLACE(A2,"/edit.*$","/pubhtml"). Do not change the spreadsheet URL in A2.
Step-by-step
Select the targetCreate a published-view URL in B2.
Apply the changeEnter exactly =REGEXREPLACE(A2,"/edit.*$","/pubhtml").
Shortcut or faster method
Select the target cell, type or paste the formula in the formula bar, then press Enter.
Expected result
B2 contains the public web-view form of the spreadsheet URL.
Common mistake
Changing the source values while applying the formatting or structure change.
Troubleshooting
Re-select B2 and repeat the final action. B2 contains the public web-view form of the spreadsheet URL.
Example spreadsheet data
This is the clean fixture used for the verified run.
| Spreadsheet URL | Published web URL |
| https://docs.google.com/spreadsheets/d/1SheetStepsExample/edit#gid=0 |
Video transcript
- Open the prepared Publish link spreadsheet.
- Select the target. Create a published-view URL in B2.
- Apply the change. Enter exactly =REGEXREPLACE(A2,"/edit.*$","/pubhtml").
- B2 contains the public web-view form of the spreadsheet URL.