Monday 15 February 2010

VBA Excel: How to execute a function for each cell in a column and loop through all workbooks? -


Here's what I've done so far:

  sub-trimm columns () each work In this workbook ActiveSite in each C for range for worksheets cc Usdrenj.Colume ("D"). Cells c.Value = worksheet function. Remand (C.Vell) Next C next cm over Sub   

The trim function only works on the worksheet's cells, but this is the same. Any suggestions?

Thank you in advance

You need to change this line:

  ActiveSheet.UsedRange.Column ("D") in each case. In cells:   

In this one:

  refers to the active sheet in the internal loop of your code, while it is  ws variable   

sheet.

No comments:

Post a Comment