Results 1 to 6 of 6

Thread: Insert macros into another sheet

  1. #1
    Join Date
    Aug 2010
    Posts
    38

    Insert macros into another sheet

    Hello,
    I am a constant user of Excel and I create a lot of excel sheets with formulas embedded in them. But I have a problem with one of the sheets now. I need some codes for this excel sheet.
    Here is what I have

    Sheet 1
    DNum ANum
    5641321454 564542
    5641321454 564546

    5641321454 564542
    5641321454 564546

    Sheet 2
    545434654 74212
    545434654 74212

    545434654 742745
    545434654 742745

    I have already omitted the duplicates which are on the sheet no 1 with colums DNum and ANum. I want both the colums in a unique format. So, if you know how can I do this using macros then please let me know. Thank you.

  2. #2
    Join Date
    May 2008
    Posts
    255

    Re: Insert macros into another sheet

    I am not pro in excel but I think you can just loop you excel program through each row of your sheet. What is the value of the cell in your column A? If this is examined and the is same then you will need to change it to the appropriate value. What is the name of you excel sheet , please try to provide name of both the sheets? May be the name of the sheets are same and so the value may be duplicated.

  3. #3
    Join Date
    Mar 2010
    Posts
    184

    Re: Insert macros into another sheet

    In you macro script what is the value of selection.pastespecial? If you are getting this error in your macro script then this might be because of the overflow of rows and columns.
    Here is an example
    Code:
    Range(Selection, Selection.End(xdwn)).Select
    Please check that some of the rows in between are not blank. If you have a blank row in between then you will get an error message as the script will not be applied to the remaining data of your row.

  4. #4
    Join Date
    Aug 2010
    Posts
    38

    Re: Insert macros into another sheet

    Ok, I find that I get the same error that you have mentioned in your post. What should I do to correct it now? I had tried some options, but I think the template which is provide by Microsoft will work here , I mean to say the sheet.add function. though i am not sure abut this. Please help me with this? Thank you for your replies.

  5. #5
    Join Date
    Nov 2009
    Posts
    359

    Re: Insert macros into another sheet

    Hello,
    If you have not tried this formula then you can try the one mentioned below. This function will extend your last cell of the column. If you wish you can try it out.
    Code:
    Range("R3").Select
    Range(Selection, Selection.End(xdw)).Select
    If this does not work for you then you can post back with the updated query / error message you are getting.

  6. #6
    Join Date
    Nov 2010
    Posts
    1

    question Re: Insert macro code from one sheet to multiple sheets

    Hiii
    I need ur help in solving my problem.I have a macro code as shown below
    '
    '
    '
    Windows(""Dt9-04208146.xls").Activate
    Range("N321:O368").Select
    Selection.Copy
    Windows("inputformat_jag.xls").Activate
    Sheets("07-07").Select
    Range("L20:L21").Select
    Selection.PasteSpecial Paste:=xlPastevalues, Operation:=xlNone, SkipBlanks_:=False,Transpose:=True
    Sheets(07-07").Select

    Windows(""Dt9-04208146.xls").Activate
    Range("N374:O421").Select
    Selection.Copy
    Windows("inputformat_jag.xls").Activate
    Sheets("08-07").Select
    Range("L20:L21").Select
    Selection.PasteSpecial Paste:=xlPastevalues, Operation:=xlNone, SkipBlanks_:=False,Transpose:=True
    Sheets(08-07").Select
    '
    '
    '
    like this we have a macro code for one workbook.
    My query is that I have many work books with some 12 to 15 sheets.since i have workbooks i want to copy the code at the same time instead of doing it each and every time.

    please solve my problem.
    I want to know whether there is any single command to do this??

Similar Threads

  1. How to insert HyperTerminal data into excel sheet.
    By Shaina Na in forum Microsoft Project
    Replies: 1
    Last Post: 08-01-2012, 07:44 PM
  2. Replies: 1
    Last Post: 07-01-2012, 06:34 PM
  3. Replies: 8
    Last Post: 12-09-2011, 10:46 PM
  4. how to copy data from sheet 1 to sheet 2 using macro
    By Messenger in forum Windows Software
    Replies: 3
    Last Post: 26-10-2010, 06:28 AM
  5. How to export column from one sheet to another sheet ?
    By Metechman in forum Windows Software
    Replies: 3
    Last Post: 26-02-2009, 07:11 PM

Tags for this Thread

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
  •  
Page generated in 1,727,314,769.80477 seconds with 17 queries