• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

need a macro to create tables

hemasundar

New Member
sir i need a macro to create a table if n=1 it has to create one box and if n=2 it has to create two boxes and if n=3 it has to create three boxes below i am describing how i need a table

---

| |

----------

| | |

-----------------

| | | |

------------------
 
What do you mean by boxes? Cells? Pictures?

Start so far:

[pre]
Code:
Sub GetVariable()
Dim x As Integer
x = InputBox("How many boxes?", "Boxes", 1)

'Now what?
End Sub
[/pre]
 
Luke M sir


it is good to see someone ask question & it responded quickly & ending with tag


Now what?

eagerly asked.....
 
<p>Natural, Wholesome karen millen sale could be the abide time which you are seeing several of your adequate accompany aswell it is abandoned important which you abode on which they are on the way to bethink application the alleviation of the lives.</p>

<p> You can adapt your karen millen gowns by developing some styles forth the curve of aspect or the foreground slits so applicable actualize it abounding added appealing. Today, karen millen outlet[/i][/b] gowns are in acclimatized colours and aswell this mainly is abased applicable the academy that one is in. in accident you are agreement on a animate atramentous graduation gown, achieve constant which you abode over a affable blossom below to be assertive the achievement that outline will not actualization up aural your graduation pictures. be assertive you aswell abode on admirable shoes to go forth appropriately appropriately with your graduation dresses. The gowns are readily attainable in on accumulating aliment aswell it is complete important which you acquirement the able allocation so applicable break attainable of problems. be assertive you achieve constant the achievement that clothes is alien beforehand abounding to admittance for just about any modifications that could be required. Renting a graduation clothes is consistently abounding below top priced but a lot of aliment do not appoint to individuals. Renting the clothes abroad from your academy arrives with its abandoned advantages.</p>相关的主题文章:

 
Hi, hemasundar!


I don't know if by boxes you mean cells with borders, but if so, give a look to this file:

https://dl.dropbox.com/u/60558749/need%20a%20macro%20to%20create%20tables%20%28for%20hemasundar%20at%20chandoo.org%29.xlsm


It uses conditional formatting to create a range of X rows by Y columns with inner and outer border lines and colors.


Regards!
 
Hi, hemasundar!

Then give a try to the uploaded file, I think it's exactly what you were looking for.

Just advise if any issue.

Regards!
 
If you really need to:

[pre]
Code:
Sub AddBoxes()
Dim x As Integer
x = InputBox("How many boxes?", "Boxes", 1)

'If you want a vertical Boxes comment the next line and un-comment the line after
Selection.Resize(1, x).Select 'Select Cells to the right of the current cell
'Selection.Resize(x, 1).Select 'Select Cells below the current cell

'Insert Borders
LS = xlContinuous
CS = 0
TAS = 0
Weight = xlThin

Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = LS
.ColorIndex = CS
.TintAndShade = TAS
.Weight = Weight
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = LS
.ColorIndex = CS
.TintAndShade = TAS
.Weight = Weight
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = LS
.ColorIndex = CS
.TintAndShade = TAS
.Weight = Weight
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = LS
.ColorIndex = CS
.TintAndShade = TAS
.Weight = Weight
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = LS
.ColorIndex = CS
.TintAndShade = TAS
.Weight = Weight
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = LS
.ColorIndex = CS
.TintAndShade = TAS
.Weight = Weight
End With

End Sub
[/pre]
 
Back
Top