+ Reply to Thread
Results 1 to 9 of 9

Help With Excel Macro Renaming Row On Sheet

  1. #1
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Help With Excel Macro Renaming Row On Sheet

    Hello,
    Need some help with the below macro. I open my Excel and as default it opens with one sheet called sheet1 with below code. I then open a csv file, and another sheet is created called WEBDATA. When I run the below macro, column headers in sheet1 is set as per below macro, and data in sheet WEBDATA is sorted as per macro. What I need, is the header change to happen on sheet WEBDATA, where the data is being sorted.. I have tried changing (With sheet1) to (With WEBDATA), and I get an error.

    Please Login or Register  to view this content.
    Thank you, JR

  2. #2
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help With Excel Macro Renaming Row On Sheet

    the sheets you are opening, are they both a part of the same workbook?

  3. #3
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Help With Excel Macro Renaming Row On Sheet

    Hello,

    Yes.

  4. #4
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help With Excel Macro Renaming Row On Sheet

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Help With Excel Macro Renaming Row On Sheet

    Hello,

    thank you for the suggestion. I tried it, but I get error, script out of range?

    Thanks Jr

  6. #6
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help With Excel Macro Renaming Row On Sheet

    I would be assuming this is what your workbook looks like:

    gaspower.xlsm

    So when you run that script all it does is switch sheet and run what you told it to. If there is more code that you are not showing me, you need to add that code into your existing macro. Try the sheet I attached, and if that isnt your setup then you need to get that to be your setup, or you need to modify the code more. This assumes that both sheets are in the same workbook together

  7. #7
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Help With Excel Macro Renaming Row On Sheet

    Hello,

    Sorry, I just realized my error explaining it to you. Actually two work books. When I open the excel, default workbook called inventory with just sheet1. When I open the csv file, another workbook is created as seen here:
    Capture1.jpg

    After running macro, I need output to look like this, and preferably delete first workbook:
    Capture2.jpg

    Thanks JR

  8. #8
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help With Excel Macro Renaming Row On Sheet

    Please Login or Register  to view this content.
    on the
    Windows("WEBDATA.xlsm").Activate
    and
    Windows("Inventory.xlsm").Activate


    You may need to remove the file extension or change it to the extension your file is in

  9. #9
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Help With Excel Macro Renaming Row On Sheet

    Hello,

    First I would like to thank jayinthe813 and apologize for not seeing your post earlier. I did not receive a notification that you posted, sorry.

    I did try you code and changed the names as instructed, but sorry, I still get a out of range error. I attached a sample Excel file that you can see what I get prior to your code. If you open the file and do alt f8, it will almost get all the way. The inventory sheet is labeled correctly at the columns, but I need to take that and have it on the sheet called sample.

    Thanks Jr
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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