+ Reply to Thread
Results 1 to 15 of 15

How to write a macro? (excel 2010)

  1. #1
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    How to write a macro? (excel 2010)

    I'm amater in Excel, not profi, and don't know anything about programing.

    In attachemnt is what I need.

    COMPLETE EXAMPLE.

    1st sheet is short example to understand how it works, with ONE LINE.

    2nd sheet is complete example, where can be many lines. In example I put 64 lines (it could be 128, 256, 512, 1024, 2048...)

    NOTE: Integers and Number of terms (N) in seria can be very huge (so AS LONG).

    Thank You for help.

    Have a nice day.
    Attached Files Attached Files
    Last edited by sasamaribor; 12-05-2023 at 06:08 AM.

  2. #2
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2404-17531.20128
    Posts
    1,361

    Re: How to write a macro? (excel 2010)

    Welcome to the forum sasamaribor,

    How will you pass the values to VBA, will they be in a specific range in a sheet?
    Maybe the array will already be in VBA?

    If i understand correctly then you could use the functions below for a worksheet range:
    Please Login or Register  to view this content.
    If the array is in VBA already then maybe the below will help:
    Please Login or Register  to view this content.
    With formula you can get the same result with:
    First number:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Second number:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by CheeseSandwich; 12-04-2023 at 03:43 AM.
    If things don't change they stay the same

  3. #3
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    Re: How to write a macro? (excel 2010)

    Hello,

    Pair of two numbers (A1, B1) are always different. And each number is in its own cell.

    First number always mean the beginning of a seria (written verticaly), and the second number always mean how many terms are in a seria.Stavek (1).xls
    Last edited by sasamaribor; 12-04-2023 at 05:07 AM.

  4. #4
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    Re: How to write a macro? (excel 2010)

    Task is oposite.

    In BASIC:

    We have 2 numbers. And the seria has to be result.

    First number is the first term of seria, and the second number is the number of terms in seria.

    We have to form a seria. Written verticaly.


    Concrete Example in XLS.
    Attached Files Attached Files
    Last edited by sasamaribor; 12-04-2023 at 06:06 AM.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: How to write a macro? (excel 2010)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    Re: How to write a macro? (excel 2010)

    I have Excel 2010.

    I can not activate RUN button in worksheet You've sent me.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: How to write a macro? (excel 2010)

    Clear data from B6 down and then RUN as otherwise you will not see the update: I too have Excel 2010

  8. #8
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2404-17531.20128
    Posts
    1,361

    Re: How to write a macro? (excel 2010)

    Sorry i went the wrong way with the logic, here is another piece of code that gives the same result:
    Please Login or Register  to view this content.
    Last edited by CheeseSandwich; 12-04-2023 at 06:06 AM.

  9. #9
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    Re: How to write a macro? (excel 2010)

    Thanks.
    Can You please look at concrete short example.exe? (attached in posted forum)
    I am sure you can manage this.
    Thank You very much.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: How to write a macro? (excel 2010)

    Can You please look at concrete short example.exe? (attached in posted forum)
    Don't understand
    Last edited by JohnTopley; 12-04-2023 at 06:37 AM.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: How to write a macro? (excel 2010)

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    Re: How to write a macro? (excel 2010)

    You could open file Example.xls?

    I do not know how to attach it in private massage.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,253

    Re: How to write a macro? (excel 2010)

    Not sure what you mean...
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    12-04-2023
    Location
    Slovenia
    MS-Off Ver
    2010
    Posts
    53

    Re: How to write a macro? (excel 2010)

    Not attachment Stavek(1).xls.

    I have attached also Example.xls. You do not see it?
    Attached Files Attached Files
    Last edited by sasamaribor; 12-04-2023 at 06:55 AM.

  15. #15
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2404-17531.20128
    Posts
    1,361

    Re: How to write a macro? (excel 2010)

    My attempt at getting to where you want to be, at this stage it is a bit of a guess:

    Left:
    Please Login or Register  to view this content.
    Right:
    Please Login or Register  to view this content.
    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)

Similar Threads

  1. [SOLVED] Excel VBA 2010 - Is it possible to have an input box write an Option Explicit?
    By b4tmast in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2015, 10:58 PM
  2. Excel 2010 to Outlook 2010 plus word macro?
    By Abe Froman in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2014, 11:28 PM
  3. [SOLVED] Getting a outlook warning (2010) while sending an email through excel 2010 macro
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-26-2014, 12:21 PM
  4. Multiple user write access to an Excel 2010 file
    By musik7 in forum Excel General
    Replies: 1
    Last Post: 03-21-2014, 01:24 PM
  5. [SOLVED] Cannot write a formula in Excel 2010 to answer query and give a final COUNTIF number
    By Kevin Fisher in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-09-2014, 04:04 PM
  6. How to Convert Word 2010 doc to Excel 2010 that contains several tables (one macro)
    By theglitch in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 01:36 PM
  7. Read Data into an Array, Write Data into Another Sheet (Excel VBA Only) [v14/2010]
    By lloydgodin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-15-2012, 07:22 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