Hi, Fred99,
and what about the data which already has been inserted into the survey?
Please try the code on a copy of your workbook.
The following macro has to be executed on the survey sheet (it will always run on the sheet which is active in the Excel application). Press ALT+F11 to enter the VBE, search for the workbook name in the project explorer, expand the project if only a + is shown, insert a standard module via menu, insert the following code there, press F5 to run the macro:
Sub Fred99()
'http://www.excelforum.com/excel-programming-vba-macros/858367-move-data-row-by-row-to-left-hand-side-of-an-array-across-blank-cells.html
'macro works on the activesheet and will shift data to the left
'avoid any information about errors
On Error Resume Next
'delete the empty cells in the range, shift to left
ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Delete shift:=xlShiftToLeft
'check, if an error occurred
If Err <> 0 Then
MsgBox "no blanks in active sheet"
End If
'go back to normal error handling
On Error GoTo 0
End Sub
If you have any questions regarding the code or problems with the deletion of cells (unwanted results) please come back and tell us about these. This might be the start of one way to solve the problem.
If you cannot run macro actions in your workbook go to the symbol in the upper left, choose Excel-Options, Safety, check the button for macro security.
Ciao,
Holger
Bookmarks