how to insert image into reply?

I understand the need for a different method when it comes to code. Would adding code tags in posde code accomplish the same thing

No code tags are only for formatting vba code in a thread you can't use them for images.
If you post code directly in the thread you get...

Sub SumColour()
Dim rCell As Range, vResult, rSumRange As Range, SC As Long
Set rSumRange = Range("a1:a20")
For Each rCell In rSumRange
If rCell.Interior.Color = RGB(141, 180, 226) Then
vResult = WorksheetFunction.Sum(rCell) + vResult
End If
Next rCell
SC = vResult
Cells(1, 4).Value = SC
End Sub

with code tags you get

Code:
Sub SumColour()
    Dim rCell As Range, vResult, rSumRange As Range, SC As Long
    Set rSumRange = Range("a1:a20")
    For Each rCell In rSumRange
        If rCell.Interior.Color = RGB(141, 180, 226) Then
            vResult = WorksheetFunction.Sum(rCell) + vResult
        End If
    Next rCell
    SC = vResult
    Cells(1, 4).Value = SC
End Sub

Just keeps the indentation etc. in place to make it more readable.

When I post an image it's usually a screenshot; see the example I posted to Pete earlier. I just wanted him to see where I put the file and what I was seeing and why I was confused.

My apologies that is a perfectly legitimate use of images and there isn't really any other option but to use images for that.
 
No code tags are only for formatting vba code in a thread you can't use them for images.
If you post code directly in the thread you get...

Sub SumColour()
Dim rCell As Range, vResult, rSumRange As Range, SC As Long
Set rSumRange = Range("a1:a20")
For Each rCell In rSumRange
If rCell.Interior.Color = RGB(141, 180, 226) Then
vResult = WorksheetFunction.Sum(rCell) + vResult
End If
Next rCell
SC = vResult
Cells(1, 4).Value = SC
End Sub

with code tags you get

Code:
Sub SumColour()
    Dim rCell As Range, vResult, rSumRange As Range, SC As Long
    Set rSumRange = Range("a1:a20")
    For Each rCell In rSumRange
        If rCell.Interior.Color = RGB(141, 180, 226) Then
            vResult = WorksheetFunction.Sum(rCell) + vResult
        End If
    Next rCell
    SC = vResult
    Cells(1, 4).Value = SC
End Sub

Just keeps the indentation etc. in place to make it more readable.
.
Ok, I understand that code tags aren't the same as images, but are they usable as code; I mean as apposed to images. Can I enter code, with code tags, that can be copied and plugged into XL without retyping?
 
You can copy both code with code tags and without tags directly into the vb editor if that is what you mean (well 95% of code without tags). You can't copy an image into the editor.

The code tags make the code easier to read both on the forum and in the editor, again if it is easy to read = more chance of getting an answer.

Basically always use Code tags when posting code.
 
You can copy both code with code tags and without tags directly into the vb editor if that is what you mean (well 95% of code without tags).

The code tags make the code easier to read both on the forum and in the editor, again if it is easy to read = more chance of getting an answer.

Basically always use Code tags when posting code.

I'm really sorry to drag this out but I'm trying to get it clear in my head; exactly what code tags do and don't do, because I expect I'll be posting a lot of questions, as I study VBA and don't want to make a difficult for people to deal with them.

If I'm in the VBE don't I organize the lines in my code; to made them easy to read?

If I lay down several lines of code, using a kind our outline format; with indentations, etc., then add code tags at the start and end what will change?

If I write the same code without indentations and add code tags what will change?

I'm just trying to understand why I would put code tags in code that I've entered into the VBE.

I could see why I would enter code tags here but I'm not sure what the advantage of code tags is if I copy the code as laid out in the VBE.

I know that Quote tags enclose a section of text, do code tags to the same; block the code and highlight it? Why not just us quote tags; if that's the case. Which I'm sure it isn't /-:

If I add code here, and put code tags at the start and end, will it be possible to cut and paste that code into a VBE on the other end; and make it work, or do I still need HTL maker to do that?

You can't copy an image into the editor.
I'm really clear on that point.
 
Really Mike, I should tell tou to go to the Test Forum and play with the options yourself but I will show some

First of all
If I'm in the VBE don't I organize the lines in my code; to made them easy to read?
Of course you do (and still need to). The issue is how the Vbullitin software interprets what you have typed.

What I have done below is put in the same code multiple times some indented and some not, with a line above saying how each have been put on the board.

Each piece of code follows the same layout i.e have a line explaining how each have been put on the board and then the code on the immediate next line.

No indent, no code tags
Sub TxtCol()
Dim c As Long, LstCo As Long
Application.ScreenUpdating = 0

Cells.UnMerge
LstCo = Cells.Find(What:="*", SearchOrder:=xlColumns, SearchDirection:=xlPrevious, LookIn:=xlValues).Column
For c = 1 To LstCo
On Error Resume Next

With Columns(c)
.TextToColumns Destination:=Cells(1, c), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
.HorizontalAlignment = xlGeneral
End With

Next
On Error GoTo 0
Application.ScreenUpdating = 1
End Sub
No indent, with code tags
Code:
Sub TxtCol()
Dim c As Long, LstCo As Long
Application.ScreenUpdating = 0

Cells.UnMerge
LstCo = Cells.Find(What:="*", SearchOrder:=xlColumns, SearchDirection:=xlPrevious, LookIn:=xlValues).Column
For c = 1 To LstCo
On Error Resume Next
        
With Columns(c)
.TextToColumns Destination:=Cells(1, c), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
.HorizontalAlignment = xlGeneral
End With
    
Next
On Error GoTo 0
Application.ScreenUpdating = 1
End Sub
Indented, without code tags
Sub TxtCol()
Dim c As Long, LstCo As Long
Application.ScreenUpdating = 0

Cells.UnMerge
LstCo = Cells.Find(What:="*", SearchOrder:=xlColumns, SearchDirection:=xlPrevious, LookIn:=xlValues).Column
For c = 1 To LstCo
On Error Resume Next

With Columns(c)
.TextToColumns Destination:=Cells(1, c), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
.HorizontalAlignment = xlGeneral
End With

Next
On Error GoTo 0
Application.ScreenUpdating = 1
End Sub
Indented with code tags
Code:
Sub TxtCol()
    Dim c As Long, LstCo As Long
    Application.ScreenUpdating = 0

    Cells.UnMerge
    LstCo = Cells.Find(What:="*", SearchOrder:=xlColumns, SearchDirection:=xlPrevious, LookIn:=xlValues).Column
    For c = 1 To LstCo
        On Error Resume Next

        With Columns(c)
            .TextToColumns Destination:=Cells(1, c), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
                           Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
                                                                                     :=Array(1, 1), TrailingMinusNumbers:=True
            .HorizontalAlignment = xlGeneral
        End With

    Next
    On Error GoTo 0
    Application.ScreenUpdating = 1
End Sub
And just because you mention Quote tags
Indented with quote tags
Sub TxtCol()
Dim c As Long, LstCo As Long
Application.ScreenUpdating = 0

Cells.UnMerge
LstCo = Cells.Find(What:="*", SearchOrder:=xlColumns, SearchDirection:=xlPrevious, LookIn:=xlValues).Column
For c = 1 To LstCo
On Error Resume Next

With Columns(c)
.TextToColumns Destination:=Cells(1, c), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
.HorizontalAlignment = xlGeneral
End With

Next
On Error GoTo 0
Application.ScreenUpdating = 1
End Sub
As you can see Quote tags lose the indenting.

And finally With the VBHtml maker (although you won't be able to use this but it will save you asking later).
Rich (BB code):
Sub TxtCol()
    Dim c As Long, LstCo As Long
    Application.ScreenUpdating = 0

    Cells.UnMerge
    LstCo = Cells.Find(What:="*", SearchOrder:=xlColumns, SearchDirection:=xlPrevious, LookIn:=xlValues).Column
    For c = 1 To LstCo
        On Error Resume Next

        With Columns(c)
            .TextToColumns Destination:=Cells(1, c), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
                           Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
                                                                                     :=Array(1, 1), TrailingMinusNumbers:=True
            .HorizontalAlignment = xlGeneral
        End With

    Next
    On Error GoTo 0
    Application.ScreenUpdating = 1
End Sub
I will let you judge the differences yourself (test including adjusting your zoom settings and pasting the codes above into your VBE) and like I said you can experiment yourself further in the Test Forum.
 
Last edited:
Really Mike, I should tell tou to go to the Test Forum and play with the options yourself

Yes, I know about that page; I was recently told about here, and your right.

I actually thought about doing that; but I have so little experience with writing code that it would have been a struggle for me; though I could probably have managed; it would have just been very time consuming. I tell you that just so you won't think I'm a free loader and want everything done for me. I do try to be responsible and not take advantage; like I do "search", though I often get way too many results (-:

That said; thank-you for your detailed explanations. I truly appreciate all the time and effort you have put in here, with my endless questions.

I think I can leave you in peace now :p
 
The signature block is the text that appears at the bottom of every post some people make.
In Peter's case it starts where the text "Hope this helps, good luck" is and in my case where the red "Using Excel 2010" is.
You will notice that there is s faint line above the signature block.
 
Last edited:

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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