Sep 15 2017
04:16 AM
- last edited on
Jul 25 2018
09:39 AM
by
TechCommunityAP
Sep 15 2017
04:16 AM
- last edited on
Jul 25 2018
09:39 AM
by
TechCommunityAP
I have a sheet into which I record new customer enquiries in consecutive rows.
Formula in the same row in subsequent columns pick out keywords and construct an appropriate reply from concatenated strings. Because the number of enquiries can vary from a ZERO to 100 on a daily basis, the formula is repeated in 100 rows.
When all the enquiries have been entered, I run a macro, part of which COPIES the VALUES in the 100 consecutive rows and PASTES the output into a master sheet.
The problem is this method produces swaves of blank lines in the master sheet. Has anyone any idea how to construct the macro to eliminate the unused lines?
Rows("4:100").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Customers").Select
Rows("4:4").Select
Selection.Insert Shift:=xlDown
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False
I've tried setting SkipBlanks:= _True but one of the columns always returns the MATCH #N/A error, so the row is never blank.
=IF(MATCH(B4,Customers!B$1:B$292,0)>0,"**STOP**","")
Sep 15 2017 09:03 AM
Sep 15 2017 11:07 PM
@Smitty Smith wrote:
The easiest way is to use a Filter on a column that has your delete criteria, then Go To (F5) > Special > Visible cells only > Delete rows > turn off the filter. All of which is easily recordable.
... thanks for this. Didn't think of filters so I'm working on it. After selecting "Visible cells only >" I'm not getting "Delete rows" but XThe selection already contains only visible cells"
As I say, I'm working on it so any help is invaluable. Thank you for helping.
Sep 16 2017 01:06 PM
If your data is in a table, you can use Alt+H+D+L. If it's in a regular range, you can use Alt+E+D+R. Or the long way, go to Home > Cells > Delete >Delete sheet/table rows.
Sep 18 2017 04:15 AM
Many thanks
I've actually managed to solve the problem in rather a complex way.
I have introduced an IF column of cells filled with IF(data_cell= "",9,1)
so when data is entered in the relevant data_cell the corresponding cell changes from 9 to 1.
Then further IF statements determine IF(cell=1,data,"") so now, all unused cells are blank.
When the Macro adds the cells to the master customer sheet, the SORT ignores the blank cells.
Well, it might not be the best solution, but it works!
Thanks for your help -I'm learning !!