+ Reply to Thread
Results 1 to 5 of 5

VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?

  1. #1
    Registered User
    Join Date
    04-05-2020
    Location
    England
    MS-Off Ver
    Excel 365 MSO 2011 (32bit)
    Posts
    20

    VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?

    So I'm a novice to VBA, used Excel for years self taught but trying to get my head around VBA coding.
    I have written for a work delivery spreadsheet to send out automated texts when dispatching an order. However there are several references to cell numbers in the code (E8, M8, B8, K8) and I need to be able to change these for each button working down my spreadsheet.
    I have about 50 per sheet & 5 sheets to do so looking for the fastest and easiest way to replicate the code without having to do 250 individual buttons & code.
    Any help and advice is greatly appreciated.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Registered User
    Join Date
    04-05-2020
    Location
    England
    MS-Off Ver
    Excel 365 MSO 2011 (32bit)
    Posts
    20

    Re: VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?

    Pepe Le Mokko thank you.
    It certainly wasn't for lack of trying! It only would post without attachment & wouldn't let me copy the code into the description before posting. Hopefully I have now managed to upload the doc.
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?

    You can use the button position to determine the row to use.

    Please Login or Register  to view this content.
    I don't see the code to add button but you may want to position the button so it does not overlap more than 1 row.
    I had to use the bottomrightcell, rather than topleftcell, in order to get correct row.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    04-05-2020
    Location
    England
    MS-Off Ver
    Excel 365 MSO 2011 (32bit)
    Posts
    20

    Re: VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?

    Andy, Works a treat, thank you so much for your help. I think I may have been scrolling Google for the next year before getting any closer with it.

+ 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. One code VBA To calculate the slope of the line and the distance between two lines on
    By HosseinDel1983 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-13-2020, 11:00 AM
  2. One code VBA To calculate the slope of the line and the distance between two lines on
    By HosseinDel1983 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2020, 04:51 AM
  3. [SOLVED] Message Box on Program Open - Way to have multiple lines of code vs one long line?
    By OpieWinston in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2018, 11:25 AM
  4. Additional Line of Code Needed
    By eoghanmolloy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2014, 07:29 AM
  5. [SOLVED] How to convert selected multiple lines of a VBA code into comment line?
    By 1tane1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2014, 11:04 AM
  6. Macro code needed to delete unnecessary data after 20 lines
    By mohammedfaizal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2013, 08:36 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1