Hi guys,
I hope you are having a good week so far. Greetings from New Zealand.
I am stuck but I will say this will be quite a basic question:
In a worksheet called "calculations" I have different 10 tables (From Table2 to Table11)
I am trying to pull the information from Table"i+1" but I am unsure how to code it.
Below is what I have but it gets stuck in the first line (on yellow)
shCalculations.Range("Table&i+1[NHI4]").Copy shInvTemplate.Range("X51")
I hope you are having a good week so far. Greetings from New Zealand.
I am stuck but I will say this will be quite a basic question:
In a worksheet called "calculations" I have different 10 tables (From Table2 to Table11)
I am trying to pull the information from Table"i+1" but I am unsure how to code it.
Below is what I have but it gets stuck in the first line (on yellow)
VBA Code:
Sub Invoice_Making()
Dim shMacros As Worksheet, shCalculations As Worksheet, shInvTemplate As Worksheet
Set shMacros = Worksheets("Macros")
Set shCalculations = Worksheets("Calculations")
Set shInvTemplate = Worksheets("Invoice Template")
'Inserts new sheets, and names them a name according to form
Sheets("Macros").Select
Dim sheet_count As Integer
sheet_count = Range("E2")
Dim sheet_name As String
Dim i As Integer
For i = 1 To sheet_count
'copy NHI from Calculations to Invoice Template
[COLOR=rgb(247, 218, 100)]shCalculations.Range("Table" & "(i+1)[NHI]").Copy shInvTemplate.Range("X3")[/COLOR]
shCalculations.Range("Table&i+1[NHI2]").Copy shInvTemplate.Range("X19")
shCalculations.Range("Table&i+1[NHI3]").Copy shInvTemplate.Range("X35")