View Single Post
 
Old 08-27-2020, 08:09 AM
mthwi mthwi is offline Windows 10 Office 2016
Novice
 
Join Date: Nov 2017
Posts: 5
mthwi is on a distinguished road
Default Insert a new Column a in specific Sheet and fill it with content

Hi,
i have the following code and it does not work.
I want to select the sheet with the first input box and with the 2. the value to be entered in the new column 'A'.

Maybe someone can correct the code.

Here is the code:
Code:
Sub Einfügen_New_A_and_Fill_with_Content_SPECIFIC_SHEET()
Dim ws As Worksheet, 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
Vielen Dank
Reply With Quote