+ Reply to Thread
Results 1 to 6 of 6

Change specific macro into a general macro

  1. #1
    Registered User
    Join Date
    12-25-2017
    Location
    UK
    MS-Off Ver
    2003
    Posts
    3

    Exclamation Change specific macro into a general macro

    I am new to MS VBA.

    I have recorded a simple macro that moves data from one cell location to another cell location within the same sheet.
    I do not wish the active cell to be static, nor do I wish the destination cell to be static. I want them to be relative to the initial cell that is selected.
    How do I change the instructions in the macro to reflect this? ie if there is data in cells C4, C5, C6; C5 is selected, the data is cut and pasted into D4; then C6 is selected, the data is cut and pasted into E4.
    If I were to select C11 and run the macro, the data in C11 is cut and pasted into D10; then C12 is selected, the data is cut and pasted into E12. etc

    Please Login or Register  to view this content.
    How can I make the cell addresses in the macro general ie ("C53") becomes active cell instead of a named cell?

    Thank yoy
    Last edited by zbor; 12-25-2017 at 12:02 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Change specific macro into a general macro

    How about
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-25-2017
    Location
    UK
    MS-Off Ver
    2003
    Posts
    3

    Re: Change specific macro into a general macro

    Hi Fluff13

    thank you ever so much for your solution and very quick response.
    Hope you are having a great Christmas Day.

    May I ask for some more assistance, please? Now that data within cells have been transposed from a single column to a single row with multiple columns, this now leaves multiple rows empty of any data. What is the easiest way to delete these multiple empty rows? As I am selecting the empty rows then pressing Alt+E+D There are hundreds of empty row blocks to delete!
    Thank you once again

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Change specific macro into a general macro

    How about
    Please Login or Register  to view this content.
    This will delete the entire row where col C is blank

  5. #5
    Registered User
    Join Date
    12-25-2017
    Location
    UK
    MS-Off Ver
    2003
    Posts
    3

    Re: Change specific macro into a general macro

    Hi Fluff13,

    thank you ever so much. That has been a great help, the code deleted the rows.
    Hope you are having a good Boxing Day.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: Change specific macro into a general macro

    Glad to help & thanks for the feedback

+ 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: 06-01-2013, 05:32 PM
  2. [SOLVED] Worksheet change macro on a change in a specific cell
    By dzuspann in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2012, 04:19 PM
  3. How do I change a recorded macro to make it general?
    By excelVBAn00b in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2012, 03:38 PM
  4. How to change macro to specific worksheet
    By hezcal11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2011, 02:41 AM
  5. Replies: 8
    Last Post: 10-30-2010, 08:07 PM
  6. macro: paste cell from specific files to 1 general file
    By jy2009 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-28-2009, 01:05 AM
  7. How to change the desktop name from being user specific to general user?
    By punter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2007, 04:06 PM
  8. [SOLVED] Macro to only change specific cells
    By THT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2005, 01:06 PM

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