Hi Guys,
I am a learner with VBA and you guys have been my mentors and teachers for a while now (mostly i have been only reading) but now i face a problem of my own and would love if you could help me.
Basically i have two sheets representing project costs. 1 has project value and the other committed value.
What i am trying to do is combine the data from the two spreadsheets where:
* Each project needs to have it's own sheet (i.e. 1032B , 1032D...etc)
* Each new sheet (i.e. 1032B, 1032D...etc) needs to have all data for relating from both sheets where the first 4 letters in sheet("Cost type summary per project").Column("E:E") and sheet("Committed Costs").Column("H:H") are the same the value in sheet("Cost type summary per project").Column("I:I") and sheet("Committed Costs").Column("I:I") needs to be added up. (see example)
Capture.PNGCapture2.PNGCapture3.PNG
Here is my crappy code attempt
Sub Try1()
Dim wsNew As Worksheet
Dim wsData As Worksheet
Set wsData = ActiveWorkbook.Sheets("Cost type summary per project")
sheet_name_to_creat = Sheet1.Range("A:A").Value 'where i need to make it add only 1 sheet per same name
For rep = 1 To (Worksheets.Count)
Exit Sub
Next
Sheets.Add after:=Sheets(Sheets.Count)
Sheets(ActiveSheet.Name).Name = Sheet_name_to_create
Set wsNew = ActiveWorkbook.ActiveSheet
'grabbing the information to copy in the sheets
Dim myData As String
myData = ?
'Then put it in the newly added sheet
wsNew.Range("A1").Value = myData
End Sub
If anyone has any ideas would be most appreciated.
Bookmarks