• 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.

How do I post my code in the forum in same format as is apprears on VBA

gumbles

New Member
Hello all,


This is probably a very simple question but many times I have posted code and i loose all the formatting.


How do I keep the VBA format when posting here?


Regards,


Gumbles
 
Please use backticks to wrap the code around.


e.g.

(backtick) Here is my code (backtick)


Now replace (backtick) with brackets that is with ` character. When you are replying, just below your reply box it will tell you about allowed markup.
 
Thanks Shri,


`With ActiveCell

.ListObject.ListRows.Add (Ro - Header_Row + 2)

.Offset(Ro).EntireRow.Hidden = False

End With

End With `
 
Code:
With ActiveCell

[code].ListObject.ListRows.Add (Ro - Header_Row + 2)

[code].Offset(Ro).EntireRow.Hidden = False

End With[/code]

End With[/code]
 
Code:
Dim Ro As Long

`   With ActiveSheet

`       Ro = .Shapes(Application.Caller).TopLeftCell.Row

`        .Cells(1, 1).Offset(Ro).Select

`

`        'ListObject.ListRow referes to the table within the worksheet,

'therfore needs to be offset to change the row numbers so they match up with
the table

` '(Ro - Header_Row + 2) does this.

`

` With ActiveCell

` .ListObject.ListRows.Add (Ro - Header_Row + 2)

` .Offset(Ro).EntireRow.Hidden = False

` End With

` End With
 
Code:
Dim Ro As Long

[code]With ActiveSheet

[code]Ro = .Shapes(Application.Caller).TopLeftCell.Row

[code].Cells(1, 1).Offset(Ro).Select

`

[code]'ListObject.ListRow refers to the table within the worksheet,

[code]'therefore needs to be offset to change the row numbers so they match up with [code]the table

'(Ro - Header_Row + 2) does this.[/code]

`

With ActiveCell[/code]

.ListObject.ListRows.Add (Ro - Header_Row + 2)[/code]

.Offset(Ro).EntireRow.Hidden = False[/code]

End With[/code]

End With[/code]
 
Hi ,


You need not put the backticks before and after each line of code ; just one backtick before the D of Dim , and one after the h of the second With is enough.


Narayan
 
check this one..


http://chandoo.org/wp/2011/11/04/fancy-posts-using-html-display-codes/


Regards,

Deb
 
Its changing the Font but not keeping the Indent...


I am puting ` before and after each line of code but it only changes the font. What am I doing wrong?
 
[pre]
Code:
Dim Ro As Long
With ActiveSheet
Ro = .Shapes(Application.Caller).TopLeftCell.Row
.Cells(1, 1).Offset(Ro).Select

'ListObject.ListRow refers to the table within the worksheet,
'therefore needs to be offset to change the row numbers so they match up with the table
'(Ro - Header_Row + 2) does this.

With ActiveCell
.ListObject.ListRows.Add (Ro - Header_Row + 2)
.Offset(Ro).EntireRow.Hidden = False
End With
End With
[/pre]
 
Back
Top