help with posting thread

Bernieg

Board Regular
Joined
Jan 1, 2009
Messages
147
Office Version
  1. 365
Platform
  1. Windows
all my threads have the text wrapped.1= line 12 = line 23 = empty line4 what are code tags and how do i apply themBernieall you see is one line !!!!!!
 
what are code tags and how do i apply them
Code tags are for posting vba code so that any indenting in the code is preserved.

You use them as shown in the bottom line of my signature block below. An Example:

Code:
Sub Room_Occupancy()
  Dim a, b
  Dim rws As Long, i As Long, j As Long, Dy As Long, Rm As Long, Nights As Long
  
  Const CI As String = "D"              '<- Check In column
  Const TopLeftResult As String = "M2"  '<- Where results should start
  Const FR As Long = 2                  '<- First data row
  Const NumRooms As Long = 4            '<- No. of rooms
  
  ReDim b(1 To 31, 1 To NumRooms * 2)
  rws = Range(CI & Rows.Count).End(xlUp).Row - FR + 1
  a = Range(CI & FR).Resize(rws, 4).Value
  For i = 1 To rws
    Dy = Day(a(i, 1))
    Rm = a(i, 3)
    Nights = a(i, 4)
    b(Dy, Rm * 2) = "C"
    For j = 1 To Nights
      b(Dy + j - 1, Rm * 2 - 1) = b(Dy + j - 1, Rm * 2 - 1) + 1
    Next j
  Next i
  Range(TopLeftResult).Resize(31, NumRooms * 2).Value = b
End Sub

If you click 'Reply with quote' at the bottom right of my post, you will see exactly how the code and code tags look before they are posted.
 

Forum statistics

Threads
1,221,553
Messages
6,160,467
Members
451,649
Latest member
fahad_ibnfurjan

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