+ Reply to Thread
Results 1 to 5 of 5

recurrence: making code work throughout a sheet

Hybrid View

Joenne recurrence: making code work... 05-21-2021, 04:23 AM
AliGW Re: recurrence: making code... 05-21-2021, 05:11 AM
Joenne Re: recurrence: making code... 05-21-2021, 06:03 AM
Sintek Re: recurrence: making code... 05-21-2021, 07:20 AM
jolivanes Re: recurrence: making code... 05-21-2021, 03:41 PM
  1. #1
    Registered User
    Join Date
    05-21-2021
    Location
    Denmark
    MS-Off Ver
    Office 365 Business
    Posts
    2

    recurrence: making code work throughout a sheet

    EDITED:

    I need the below mentioned code in Excel to work within the range of the sheet, so that the copy/paste work within the range of the sheet. C2:C81
    As of now, i can only get the compbox to work making copy/paste between the C2 and C3


    Private Sub CommandButton2_Click()
    
    If Me.ComboBox1 = Database.Range("C2") And Me.ComboBox2 = Database.Range("C3") Then
    Database.Range("A2:C2").Copy
    Database.Range("A100:C100").Insert
    Database.Range("A3:C3").Copy
    Database.Range("A2:C2").PasteSpecial
    Database.Range("A100:C100").Copy
    Database.Range("A3:C3").PasteSpecial
    Database.Range("A100:C100").clear
    Database.Range("C2:C81").Sort Key1:=Database.Range("C2"), Order1:=xlAscending, Header:=xlYes
    
    
    
    End If
    End Sub
    I need this code to work throughout the sheet, how do I do that?

    Tank you in advance
    Last edited by Joenne; 05-21-2021 at 06:01 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,265

    Re: recurrence: making code work throughout a sheet

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new I have done it for you today.)

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code] [/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. I have also done this for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-21-2021
    Location
    Denmark
    MS-Off Ver
    Office 365 Business
    Posts
    2

    Re: recurrence: making code work throughout a sheet

    I have made an edited version

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,962

    Re: recurrence: making code work throughout a sheet

    Hi Joenne

    I am very certain that someone will supply a solution if you attach a sample file and explain step by step what it is you are wanting to achieve...
    See Top Yellow Banner regarding file upload...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,704

    Re: recurrence: making code work throughout a sheet

    Supplying code that does not work is quite often no help because there are usually many ways to solve problems and everybody does it their preferred way.
    So as sintek suggests, attach a workbook with a before and after and an explanation of how you derived at the result or explain in detail what you want to achieve.

+ 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. Excel vba how to send a daily recurrence appointment email?
    By Step01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2018, 12:07 AM
  2. [SOLVED] recurrence for task list
    By excelhelpseeker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-28-2016, 02:06 AM
  3. [SOLVED] Life Cycle Spreadsheet - Issue with repeated recurrence?
    By splottoman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2016, 08:02 AM
  4. [SOLVED] Timesheet Recurrence
    By Scary123 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-08-2015, 12:15 PM
  5. count dates per month without recurrence
    By KALATRASH81 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-28-2014, 08:44 AM
  6. [SOLVED] vlookup to three values then get the mode according to the count of recurrence
    By wellous in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-16-2014, 02:55 PM
  7. Import from excel with recurrence
    By AMFISH in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2012, 02:31 PM

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