Hello!
Just joined 10 minutes ago...
I design houses in Norway and we have rules about how much sunlight is required in rooms.
Having trouble with a calculatingprogram I created for calculating the amount of sunlight that shines in a room through windows in the outer walls.
The amount of rooms and windows varies from house to house.
I use one macro for creating a new sheet for each new room, and then in each sheet I can use a macro to add a new window.
The new window macro finds the information that is needed from a different sheet and then adds the informasjon on the next available line.
I have added ActiveSheet.Name as the sheet that the information should be pasted in to.
The problem I have is that the macros work great for the first room. When I am done with the first room and then add a new room with the room macro and then try to add a new window, the new window is added to the first room.
Here are my macros:
New room:
Sub Nytt_rom()
'
' Nytt_rom Makro
'
'
Application.ScreenUpdating = False
Sheets("Hovedberegningsark").Visible = True
Sheets("Hovedberegningsark").Select
Sheets("Hovedberegningsark").Copy After:=Sheets(2)
Sheets("Hovedberegningsark (2)").Select
Sheets("Hovedberegningsark (2)").Name = "Romnavn"
Sheets("Hovedberegningsark").Visible = False
End Sub
New window
Sub Nytt_vindu()
'
' Nytt_vindu Makro
'
'
Application.ScreenUpdating = False
Sheets("Inndata").Visible = True
Sheets("Inndata").Select
Range("A1:N11").Select
Selection.Copy
Sheets("Inndata").Visible = False
Sheets(ActiveSheet.Name).Select
Cells(Rows.Count, 1).End(xlUp).Offset(3, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A39").Select
End Sub
Would appriciate any help!
Bookmarks