+ Reply to Thread
Results 1 to 3 of 3

Populate cells with MsgBox imput - Help complete VBA Macro

  1. #1
    Registered User
    Join Date
    01-31-2022
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    2

    Post Populate cells with MsgBox imput - Help complete VBA Macro

    Hello There! So i managed to create a macro that imports data from another file and it works great - it finds first and last cell pastes in the workbook (also finding first available cell).

    This is the code:

    Please Login or Register  to view this content.
    Now I want to change it to be able to ask a question during the macro "What number you want to add?" and then add this number in the last column, (see the image for more information)
    And so I did find this:
    Please Login or Register  to view this content.
    And I know that somehow I have to make a command that puts this into the first and last row...I just don't know how...
    Something like this would probably make sense:
    Please Login or Register  to view this content.
    Anyone who coukd help me optimize it? so it adds a number for each last column? (in my sheet its column DD)

    This is how I want it to work:
    Picture howitshould.png

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Populate cells with MsgBox imput - Help complete VBA Macro

    Logically, you are copying (lr-1) rows from the book you've opened and pasting them into row (lrtarget+1) into your original workbook. This makes the last paste line in your original workbook of (lrtarget+lr-1). With this in mind, you could so something like this:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    01-31-2022
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    2

    Re: Populate cells with MsgBox imput - Help complete VBA Macro

    Wow, you are a god! Thank you so much.

+ 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: 17
    Last Post: 07-10-2021, 04:53 AM
  2. Replies: 4
    Last Post: 07-07-2021, 04:49 AM
  3. [SOLVED] Step within Macro is taking forever to complete and locks up excel until complete
    By cubangt in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 05-16-2017, 11:58 AM
  4. Macro to capture MsgBox prompt to a string variable but ignore the MsgBox
    By BuglerDobbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2015, 10:56 AM
  5. Cells not updated until macro complete?
    By beeawwb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2008, 12:55 AM
  6. [SOLVED] How do I get an excel macro to stop at a cell & wait for imput?
    By oscar_az in forum Excel General
    Replies: 1
    Last Post: 01-11-2006, 09:40 AM
  7. how to create macro in excel to disallow imput of numbers
    By yummy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2005, 09:34 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