HELP! Merge cells and borders....

  • Thread starter Thread starter Maly
  • Start date Start date
M

Maly

Hi

I have TWO requests for help.

I have a macro that creates the layout of statements by
pulling the names and addresses of approx 290 clients from
one worksheet and creates the statements in a new
worksheet..

The name and address of each client is followed by 25
clear lines( Statement details to go here) before the next
name is inserted.

What I would like to be able to do is select certein cells
that need to be merged into single cells.

For instance, I have to have the 9th row of each record
and the 5th & 6th column (E & F) to be merged into a
single cell etc....

My second request is that a few of the cells need to have
bordes being single underline and double underlined.

Below is some info that may help make the explaining
clearer.(This was from somebody on the newsgroup
yesterday.)

Dim nRow As Long
Dim sRow As Long
Dim lastRow As Long
Dim wsSource As Worksheet
Dim wsNew As Worksheet
Set wsSource = ActiveSheet
Sheets.Add After:=Sheets(ActiveSheet.Name)
Set wsNew = ActiveSheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual


Any help will be greatly appreciated.

Many thanks

Malcolm
 
This should get you started...

Sub DoStatements()
Dim lRow As Long

'loop 290 times
For lRow = 1 To 7515 Step 26
'add name
Cells(lRow, 1).Value = "Name " & (lRow - 1) / 26 + 1
'merge some cells
Range(Cells(lRow + 9, 5), Cells(lRow + 9, 6)).Merge
'add double underline border
With Cells(lRow + 11, 3).Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
End With
'add single underline border
With Cells(lRow + 20, 5).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
End With
Next lRow
End Sub

Post back if you need further explaination..

Cheers,
Dave.
 
See one more response in .misc.

Hi

I have TWO requests for help.

I have a macro that creates the layout of statements by
pulling the names and addresses of approx 290 clients from
one worksheet and creates the statements in a new
worksheet..

The name and address of each client is followed by 25
clear lines( Statement details to go here) before the next
name is inserted.

What I would like to be able to do is select certein cells
that need to be merged into single cells.

For instance, I have to have the 9th row of each record
and the 5th & 6th column (E & F) to be merged into a
single cell etc....

My second request is that a few of the cells need to have
bordes being single underline and double underlined.

Below is some info that may help make the explaining
clearer.(This was from somebody on the newsgroup
yesterday.)

Dim nRow As Long
Dim sRow As Long
Dim lastRow As Long
Dim wsSource As Worksheet
Dim wsNew As Worksheet
Set wsSource = ActiveSheet
Sheets.Add After:=Sheets(ActiveSheet.Name)
Set wsNew = ActiveSheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Any help will be greatly appreciated.

Many thanks

Malcolm
 
Back
Top