+ Reply to Thread
Results 1 to 9 of 9

vba code simplifacation

  1. #1
    Registered User
    Join Date
    04-08-2013
    Location
    algerie
    MS-Off Ver
    Excel 2010
    Posts
    21

    vba code simplifacation

    HI every one

    please help me to simplify this code


    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: vba code simplifacation

    Hi, demahom08,

    maybe have a look at this for a start:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    04-08-2013
    Location
    algerie
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: vba code simplifacation

    HI Holger
    the calculate don't work
    and the special paste don't work for all sheets

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: vba code simplifacation

    Hi, demahom08,

    regarding Calculate - maybe omitt the Application and use the command the way you have done in the opening post.

    Regarding pastespecial: what doesnīt work or what do you expect the code to do? I only gave an example for one worksheet - in your sample it always will be pasted into Sheets("Power Point").

    Maybe consider attaching a sample workbook to have a look at.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    04-08-2013
    Location
    algerie
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: vba code simplifacation

    to have a result a had to put this

    i don't know why if i put rage ("b")it does't work i had to put range ("a")

    Please Login or Register  to view this content.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: vba code simplifacation

    Hi,

    i don't know why if i put rage ("b")it does't work i had to put range ("a")
    Not so understandable for anybody without looking at the workbook.

    Please mind that you would have to close the With-Stantement at the end or the next will start with the previus With Statement cell as the starting cell and work from that on. Maybe that would explain why you couldnīt use any Range starting with B as that would expand to Column C in the worksheet.

    You code would be need to look like
    Please Login or Register  to view this content.
    Maybe it should look like this instead
    Please Login or Register  to view this content.
    What still missing is to make the sheets hidden again.

    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    04-08-2013
    Location
    algerie
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: vba code simplifacation

    HI Holger it work with the secend one
    for the sheets hidden i add it
    but for this where i i have to put it
    Please Login or Register  to view this content.

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: vba code simplifacation

    Hi, demahom08,

    assuming that the action should take place on the sheet being pasted into the end of the macro may look like this:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  9. #9
    Registered User
    Join Date
    04-08-2013
    Location
    algerie
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: vba code simplifacation

    you are the best Holger
    thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  2. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  3. Adding Text to another cell VB code (Help Tweeking code) (Excel 2007)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 11:37 AM
  4. Replies: 2
    Last Post: 03-17-2011, 08:55 PM
  5. Replies: 0
    Last Post: 10-06-2006, 09:05 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