Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find cells without borders | Excel Discussion (Misc queries) | |||
Format cells with borders | Excel Discussion (Misc queries) | |||
printing cells with borders | Excel Discussion (Misc queries) | |||
Borders Don't Line up with Cells. | Excel Discussion (Misc queries) |