View Single Post
 
Old 08-27-2020, 11:53 AM
Purfleet Purfleet is offline Windows 10 Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

Pretty sure you cant have ws defined as a worksheet and assign a string to it.

If you change Dim ws as worksheet to Dim ws as variant it works

Code:
Sub Einfügen_New_A_and_Fill_with_Content_SPECIFIC_SHEET()
 Dim ws As Variant, Data$
ws = InputBox("Provide a sheet name:")
Data = InputBox("What would you like to insert in column A ?")
For Each ws In Sheets
   ws.Columns(1).Insert
   ws.Cells(1).Resize(ws.UsedRange.Rows.Count) = Data
Next
End Sub
Reply With Quote