Need understanding of text within Parentheses ex. Sub (text)

ReignEternal

New Member
Joined
Apr 11, 2021
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to learn what the text inside Parentheses () means. Because of not knowing what it means, I don't know what to properly call it. Just to clarify, I am not needing help with the VBA, I would like to know what the text within the parentheses is properly referred as. The only thing I could find refers to that as an argument but didn't go into detail. Any understanding is greatly appreciated.

Rich (BB code):
mlHeader1

Call MarkAsNormal(Selection, 1, False)

Call MarkAsHeader(Selection, 1)



Sub MarkAsNormal(ByVal target As Range, ByVal Index As Integer, Formulas As Boolean)



With Sheets("Formulas").Rows(rowNormal).Offset(Index - 1, 0)



For Each rng In target.Areas

If rng.Row < StartLine Then Exit Sub



.Copy



rng.EntireRow.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _

SkipBlanks:=False, Transpose:=False



rng.EntireRow.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _

SkipBlanks:=False, Transpose:=False



Application.CutCopyMode = False



'Reset all cells with formulas

If Formulas = True Then

Call SetFormulas(rng, Index, False)



'Set Labor Task

For Each r In rng.EntireRow.Rows

Call fLaborTask(Cells(r.Row, colModel), True)

Next

End If



Call MarkAsType(rng, Sheets("Formulas").Range("A30").Offset(Index, 0))



Next rng

End With



target.Select



End Sub



Sub MarkAsHeader(ByVal target As Range, Index As Integer)



With Sheets("Formulas").Cells(20, 1)

For Each rng In target.Areas



Call MarkAsType(rng, .Offset(Index, 0))

For Each c In rng.EntireRow.Range(Cells(1, 1), Cells(rng.Rows.Count, 1)).Cells

If UCase(c.Text) <> "N" Then c.Value = .Offset(Index, 1)

Next c

Next rng



End With



target.Select



End Sub



Sub MarkAsType(ByVal target As Range, H As Range)

Dim R1 As Integer, R2 As Integer, c As Integer

Dim NF As String



R1 = target.Row

R2 = R1 + target.Rows.Count - 1



c = colDesc



With Range(Cells(R1, c), Cells(R2, c))

.HorizontalAlignment = H.HorizontalAlignment

.Font.FontStyle = H.Font.FontStyle

.Font.Color = H.Font.Color

.Interior.Color = H.Interior.Color

.Interior.PatternColorIndex = H.Interior.PatternColorIndex

.Interior.Pattern = H.Interior.Pattern

End With



Sheets(Array("Change Order", "Bill of Materials")).Select

Range(Cells(R1, 3), Cells(R2, 8)).Select

With Selection

.HorizontalAlignment = H.HorizontalAlignment

.Font.FontStyle = H.Font.FontStyle

.Font.Color = H.Font.Color

.Interior.Color = H.Interior.Color

.Interior.PatternColorIndex = H.Interior.PatternColorIndex

.Interior.Pattern = H.Interior.Pattern

End With



Sheets(Array("BOM Without Unit Pricing", "Alternates", "GC CO BOM")).Select

Range(Cells(R1, 3), Cells(R2, 6)).Select

With Selection

.HorizontalAlignment = H.HorizontalAlignment

.Font.FontStyle = H.Font.FontStyle

.Font.Color = H.Font.Color

.Interior.Color = H.Interior.Color

.Interior.PatternColorIndex = H.Interior.PatternColorIndex

.Interior.Pattern = H.Interior.Pattern

End With



Sheets("Cost").Select



End Sub
 
Last edited by a moderator:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
They are arguments that are passed to the sub you are calling.
 
Upvote 0
Solution
In this instance the arguments are just items (be it ranges, numbers, worksheets etc) that the sub being called needs.
So in the instance of the MarkAsNormal sub, it needs a Range, an integer & a boolean as can be seen in the red highlighted portion of you code.
 
Upvote 0
In this instance the arguments are just items (be it ranges, numbers, worksheets etc) that the sub being called needs.
So in the instance of the MarkAsNormal sub, it needs a Range, an integer & a boolean as can be seen in the red highlighted portion of you code.
With what you provided, I was able to do some googling to better help me decipher the VBA I was presented with. It greatly helped and I was able to fix what my boss wanted to have fixed. I've only been dipping my toe into VBA for just over a year now so I feel I still ask noobie questions
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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