|
This is probably too simple for this place (or the incorrect location, sorry!), but I have an excel macro question to ask of you all. I'm working on a wedding list in excel, and there's some sorting functionality I'm trying to macro and assign to a big button for my fiancee. Basically, the list has these headers: Lastname, family designation, head of household, firstname, party invite, party rsvp, wedding invite, wedding rsvp Click here for the full 1104x137 image. Basically, the goal is for the macro to sort last name first, then order members of different families with same name (ie, jones) by a numerical designation (jones 1, jones 2), then it will place heads of the households at the top of the list (for that specfic name) so they can appropriately be addressed in the invitations, then sorted lastly sorted alphabetically by first name. I've got it set up so we can also filter from the headers so that my fiancee and check off people who've gotten invites to the party/wedding, and then filter the list to see who needs what, and how many are coming, etc. TLDR So, now the point. I can go through the sorting steps fine myself, and everything works how I intend. I then go to record the macro in excel, and it works, but as soon as more names are added, the macro does not work. It may work randomly after mashing the hotkeys a thousand times, or they may not. Does anybody any idea what may be happening? *This is crossposted in the Small Q megathread. I didn't realize there was an up to date one for excel, as the one in the megathread was dead. *
|
# ¿ Jan 11, 2011 23:29 |
|
|
# ¿ May 9, 2024 02:00 |
|
ZerodotJander posted:Make sure you have relative references turned on. "Use relative references" was activated by default.
|
# ¿ Jan 12, 2011 00:58 |
|
ZerodotJander posted:How are you selecting your range to sort during your macro record? Make sure whatever way you are doing that selects the full table and not just the range specified at the moment you record the macro. The range is selected via Control-A. Alternatively, clicking the top left button of the worksheet to select all has also been used. Neither method makes a difference. Numbering every guest is out of the equation. We have hundreds of people, we want it in a certain order, and that'd be just too tedious by hand. In reality, I can just show her how to sort it the way she wants (its only like 10 clicks of the mouse), and she can sort it herself when she adds new names to the list. I'm really just trying to figure this problem out, as I want a good handle on excel, and I have no idea why its not working. I figure if I can't get this simple macro like this to work, then I'm in trouble in the future. I appreciate the help.
|
# ¿ Jan 12, 2011 07:07 |
|
Sub Par posted:Can you post the code? Excel isn't very good at recording a macro with the idea of a dynamic range, and oftentimes you will need to make a couple edits to what was recorded to make it work as you intended. Certainly! Now, I by no means coded this. Purely recorded the macro, so I have little to no idea what this means. This should be the last iteration of what I tried. Excel posted:Sub Mac2() EDIT: Obviously, it looks like for some reason its ending the sorting list at row 60. So I figure if I go in and edit that to 500 or so, it should accommodate up to number, correct? EDIT2: Okay, looks like by changing all 60s to 500, it works exactly as intended. Does anyone have an idea as to why it would trim the range so low when I had selected all? Is there a way to prevent this in the future? Thanks for the help! Dead Pressed fucked around with this message at 07:25 on Jan 12, 2011 |
# ¿ Jan 12, 2011 07:20 |