CraigWolfenden
New Member
- Joined
- Sep 9, 2010
- Messages
- 39
Hello There,
I am currently trying to create a spreadsheet, it contains several sheets. I have written a formula so when you enter 1 in column A it looks up the remainder of the row from a master sheet.
My problem is depending on the month of the year depends on how many rows will be populated. Jan may have something like 4 at my site but 7 on another site.
As my formula's contain a formula to copy relevant data accross all the VB scripts I have tried simply format all the cells.
The script I am currently using is:
Sub DrawBorders()
Dim rCell As Range
Dim rRange As Range
Set rRange = Range("A1", Range("A65536").End(xlUp))
For Each rCell In rRange
If Not IsEmpty(rCell) And _
Not IsEmpty(rCell.Offset(1, 0)) Then
With rCell
If .Value <> .Offset(1, 0).Value Then
With .EntireRow.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End If
End With
End If
Next rCell
I am not very confident with VB script and this is the first I have used, although I would really like to learn the language.
Any help would be very much appreciated.
Craig.
I am currently trying to create a spreadsheet, it contains several sheets. I have written a formula so when you enter 1 in column A it looks up the remainder of the row from a master sheet.
My problem is depending on the month of the year depends on how many rows will be populated. Jan may have something like 4 at my site but 7 on another site.
As my formula's contain a formula to copy relevant data accross all the VB scripts I have tried simply format all the cells.
The script I am currently using is:
Sub DrawBorders()
Dim rCell As Range
Dim rRange As Range
Set rRange = Range("A1", Range("A65536").End(xlUp))
For Each rCell In rRange
If Not IsEmpty(rCell) And _
Not IsEmpty(rCell.Offset(1, 0)) Then
With rCell
If .Value <> .Offset(1, 0).Value Then
With .EntireRow.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
End If
End With
End If
Next rCell
I am not very confident with VB script and this is the first I have used, although I would really like to learn the language.
Any help would be very much appreciated.
Craig.