View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tempy Tempy is offline
external usenet poster
 
Posts: 203
Default Using a variable in a range

Hi all,

I have the following code which determines the amount of rows:
Dim lastrow As Long
lastrow = range("A6").End(xlDown).Row

I now need to use the "lastrow" in the formula from Bob

For Each cell In ActiveSheet.range("BD6:BD10000")
If Not cell.HasFormula Then
cell.Value = Trim(cell.Value)
End If
In other words all the spreadsheets start at BD6 but the lenght is
variable. I have tried to piece it together but cannot get it to work.

thanks

Tempy

*** Sent via Developersdex http://www.developersdex.com ***