Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default HELP! Merge cells and borders....

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default HELP! Merge cells and borders....

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.
-----Original Message-----
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
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default HELP! Merge cells and borders....

See one more response in .misc.


Maly wrote:

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


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find cells without borders Marc C Excel Discussion (Misc queries) 0 February 21st 08 08:56 PM
Format cells with borders Jim Excel Discussion (Misc queries) 3 June 10th 07 02:24 AM
printing cells with borders Jackie D Excel Discussion (Misc queries) 2 July 23rd 06 03:18 PM
Borders Don't Line up with Cells. Michael Hesse Excel Discussion (Misc queries) 0 August 30th 05 04:08 PM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"