One thing to note: there are 11 columns in the spreadsheet, so the rowValues array would be set to hold 11 values. Loop through values in rowValues and paste them into the new rowĬurrentRow += rowValues // So that the currentRow moves down below the rows we just created Store values of row(currentRow) in rowValues array (for loop maybe?) So, for example, if Organization X has 3 tickets to this event, there should be three rows with info on Organization X (i.e., copy that row and insert it twice).ĭeclare array to store all values of the current row (rowValues)ĭeclare variable to contain current row number (currentRow) What I need to do with my VBA code is create a row for each ticket. Each row contains info about each organization attending the event, including a column with the number of tickets they purchased for that event. I'm using an Excel spreadsheet to create a sign in sheet for events. I'm completely new to VBA, so I know what I want to do conceptually, but I really don't know the syntax. Enter amount of rows you wish to copy and insert in Input box. ![]() Hit View>Macros>View Macros and double-click CommandButton1Click. Test the code: Highlight the row you wish to copy. Paste the code (from above) into the code window that appears at right. ![]() ![]() I'd love some help with this bit of code I'm trying to write. Choose your workbook at left and hit Insert-Module.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |