Forum Discussion

Helen Pearson's avatar
Helen Pearson
Copper Contributor
Jun 04, 2018

debug macro

I have been sent a macro. This is the first time I've tried to use one, and I don't know how to debug.

I'm trying to condense a workbook that has data about clients on 150 different sheets. I want it all on one. The individual sheets have dates for each set of data for each client, and I need to use these.

 

The code that appears to be the problem is:

' Check to see if the header row has a date in it.
If IsDate(Cell.Value) = True Then
Debug.Print " Date found: " & Cell.Address
Set DataColumn = Workbooks(TargetFile.FileName).Worksheets(i).Range(Cells(Cell.Row + 1, Cell.Column), Cells(140, Cell.Column)) ' Use the cell indexes to create a range
Debug.Print " DataColumn = " & DataColumn.Address

' n determines the row to print on in the parent workbook. Only increment where a date is found.
n = n + 1

 

I hope someone can help me please.

Helen

 

No RepliesBe the first to reply

Resources