Hello,

I have an excel worksheet that contains information about different configurations (e.g. partnumber, description, configA, Config B, ....). Because I need to generate specific reports for each confguration I would like to use a macro that enables me to select a number of (specific) columns and copy that data to a new worksheet that I can select. However because the configurations vary, some configurations will contain different parts and thus some cells will be empty (not relevant for that configuration). I would therefore like the macro to remove any rows that I selected that contain an empty cell (effectively eliminating partnumbers and descriptions not relevant for a certain configuration).

I found the following macro:

Sub DTCopy()
'Deze functie is bedoeld om te voorkomen dat rijen met een lege cel worden meegekopieerd
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "DTCopy"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
If InputRng.Columns.Count > 1 Then
MsgBox "Please select one column."
Exit Sub
End If
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
InputRng.SpecialCells(xlCellTypeConstants).Copy Destination:=OutRng.Range("A1")
End Sub

This basically does what I want, but you can only select a single column, while I would like to select multiple columns at once. Is it possibe to adapt this macro so that this becomes possible?

Feedback would be greatly appreciated.