If posting code please use code tags.

Tomred

Board Regular
Joined
Feb 11, 2008
Messages
54
What are code tags?

I don't want to post wrongly...........

Thanks in advance.
 
Thanks jm,
I didn't realise it was referring to forum post formatting.
I didn't know it was VB ....I suppose to be honest I never thought about it....the lanugage used in forums to post messages. How do you recognise one from the other?

I though the subject to this posting was referring to a particular method to use when posting code samples.

Cheers
 
Tomred,

Not quite sure what you mean or what you are after. Perhaps a little example would help show you. Here is a little snippet of code using code tags (start by putting the word "code" in square brackets at the beginning and then the word "/code" in square brackets at the end).
Code:
    If Target.Column = 1 Then
        If Len(Cells(Target.Row, "I")) = 0 Then
            Range(Cells(Target.Row - 1, "I"), Cells(Target.Row - 1, "J")).Copy
            Cells(Target.Row, "I").Select
            ActiveSheet.Paste
            Application.CutCopyMode = False
        End If
    End If
Notice how all the spacing and indenting is maintained. Now watch what happens if I post the exact same code without code tags:

If Target.Column = 1 Then
If Len(Cells(Target.Row, "I")) = 0 Then
Range(Cells(Target.Row - 1, "I"), Cells(Target.Row - 1, "J")).Copy
Cells(Target.Row, "I").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If
End If

See how much easier the first one is to read follow? Now imagine if you have many lines of code, instead of just the few that I have posted.
 
Hi jm
Your example clearly answers my question - thanks.

I had made this posting, my first..............
http://www.mrexcel.com/forum/showthread.php?p=1486827#post1486827

...........and have been requested to use tags, but didn't know what was being referred too.

Yes ......it make lots of sense, to use the standard format for code.

PS if there is anything you would like to add to my questions at that posting, all advice is appreciated.

Thanks again.:)
 
Just be sure to put a backslash before the word in your ending "code", i.e. "/code". The starting one does not have the backslash, only the ending one. I edited your code posting in the thread you referenced.
 
Thanks jm14,
I spotted my error, corrected it and added a little more content to the posting to make it clearer....then ran out of time.

I'll put a little more thought into my posting prior to posting in future.

Over keen to get a solution to the on going problem!

:p

Food interuppted!!
 

Forum statistics

Threads
1,221,590
Messages
6,160,668
Members
451,662
Latest member
reelspike

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top