Я хотел бы обрезать ячейки, в которых есть пробелы.Но макрос у меня сейчас не работает.
Sub DoSomething()
'Declare Variables
Dim i, r, c, count, lastColData, LastRowData, lastRowInput, StartSearch As Long
Dim shtData, shtInput, shtInputI, shtInputII, shtInputIII, shtInputIV, shtInputV, shtInputVI, shtCopy As Worksheet
Dim Cell As Range
Set shtData = Sheets("PQFR")
Set shtInput = Sheets("INPUT")
Set shtInputI = Sheets("INPUTI")
Set shtInputII = Sheets("INPUTII")
Set shtInputIII = Sheets("INPUTIII")
Set shtInputIV = Sheets("INPUTIV")
Set shtInputV = Sheets("INPUTV")
Set shtInputVI = Sheets("INPUTVI")
Set shtCopy = Sheets("INPUTR")
lastColData = shtData.Cells(4, shtData.Columns.count).End(xlToLeft).Column
LastRowData = shtData.Cells(shtData.Rows.count, "A").End(xlUp).row
lastRowInput = shtInputI.Cells(shtInputI.Rows.count, "A").End(xlUp).row
'lastRowData = 10
'Remove spaces from these sheets:
shtInput.Cells(r, 32).Value = Trim(shtInput.Cell(r, 32).Value)
shtInputI.Cells(4, c).Value = Trim(shtInputI.Cells(4, c)).Value
shtInputII.Cells(4, c).Value = Trim(shtInputII.Cell(4, c)).Value
shtInputIII.Cells(4, c).Value = Trim(shtInputIII.Cell(4, c)).Value
shtInputIV.Cells(4, c).Value = Trim(shtInputIV.Cells(4, c)).Value
End Sub