Results 1 to 3 of 3

Macro - copy information from another sheet to current open sheet

Threaded View

  1. #1
    Registered User
    Join Date
    06-24-2019
    Location
    Hamar, Norway
    MS-Off Ver
    10
    Posts
    2

    Macro - copy information from another sheet to current open sheet

    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!
    Last edited by alansidman; 06-24-2019 at 05:15 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA/Macro to Automatically Update, Copy, & Sort information from Sheet 1 to Sheet 2
    By E9demello in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2017, 09:37 AM
  2. Copy range from current open sheet to a summary sheet
    By capomo64 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2015, 10:07 AM
  3. [SOLVED] VBA - Macro issue copy/paste line other sheet + duplicate current sheet
    By vcourbiere in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-17-2014, 12:06 PM
  4. Replies: 4
    Last Post: 08-16-2013, 04:10 AM
  5. [SOLVED] Macro Copy and Paste from one sheet to another sheet only where there is information
    By Elmarie_Potgieter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2013, 03:13 AM
  6. [SOLVED] Macro to copy row information from sheet to sheet won't work
    By beth.randall in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-10-2012, 01:31 PM
  7. Replies: 2
    Last Post: 03-14-2012, 03:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1