![]() |
Macros, Excel 2000
Hello all.
I had a question as to how to perform a certain task. I know how to record a Macro, but am not really sure how to get the results I want if possible. Here's the situation: I have a list of names in one sheet, followed by a checkmark. What I want to do is, when you click on the checkmark, I want that name transfered to another list in another sheet (same workbook). I understand how to do it if it takes the name and places it in another cell on the new workbook, but what if there is already something in that cell.? Is there a way to add it on the next line? Without deleating what was already there? Thanks in advance for the help! |
Macros, Excel 2000
If you have a contiguous list of data in the destination sheet (no blank
cells within the list), you can try this: Sheets("Destination_Sheet").Select Range("A2").select ' assumes column A is where you want the additional value If activecell.value = "" Then activecell.value = MyAdditionalValue Else If If activecell.value < "" and activecell.offset(1,0).value = "" Then activecell.offset(1,0).value = MyAdditionalValue Else Selection.End(xlDown).Select activecell.offset(1,0).value = MyAdditionalValue End if Hope this helps. Keith "tzam" wrote: Hello all. I had a question as to how to perform a certain task. I know how to record a Macro, but am not really sure how to get the results I want if possible. Here's the situation: I have a list of names in one sheet, followed by a checkmark. What I want to do is, when you click on the checkmark, I want that name transfered to another list in another sheet (same workbook). I understand how to do it if it takes the name and places it in another cell on the new workbook, but what if there is already something in that cell.? Is there a way to add it on the next line? Without deleating what was already there? Thanks in advance for the help! |
Macros, Excel 2000
Thanks for the info. I am still not sure how to proceed with this.
I know how to record a micro, but as far as editing it, I'm a newbie at that! Any additional help would be appreciated! "Keithlo" wrote: If you have a contiguous list of data in the destination sheet (no blank cells within the list), you can try this: Sheets("Destination_Sheet").Select Range("A2").select ' assumes column A is where you want the additional value If activecell.value = "" Then activecell.value = MyAdditionalValue Else If If activecell.value < "" and activecell.offset(1,0).value = "" Then activecell.offset(1,0).value = MyAdditionalValue Else Selection.End(xlDown).Select activecell.offset(1,0).value = MyAdditionalValue End if Hope this helps. Keith "tzam" wrote: Hello all. I had a question as to how to perform a certain task. I know how to record a Macro, but am not really sure how to get the results I want if possible. Here's the situation: I have a list of names in one sheet, followed by a checkmark. What I want to do is, when you click on the checkmark, I want that name transfered to another list in another sheet (same workbook). I understand how to do it if it takes the name and places it in another cell on the new workbook, but what if there is already something in that cell.? Is there a way to add it on the next line? Without deleating what was already there? Thanks in advance for the help! |
Macros, Excel 2000
To edit a macro, choose Tools Macro Macros, select your macro, and press
the edit button. This will open the Visual Basic Editor where you can edit your macro. Or you can simply open the Visual Basic Editor by choosing Tools Macro Visual Basic Editor. Then you would have to find your macro from the Project pane (upper left pane) by locating the Module it is in (if you recorded it, it is probably called Module1, or could be in another Module, like Module2, or Module3, depending how many times you re-recorded the macro in that file). All open files will be listed in the Project pane, with each file's sheets, forms, and Modules listed below each filename. I hope this helps. Keith "tzam" wrote: Thanks for the info. I am still not sure how to proceed with this. I know how to record a micro, but as far as editing it, I'm a newbie at that! Any additional help would be appreciated! "Keithlo" wrote: If you have a contiguous list of data in the destination sheet (no blank cells within the list), you can try this: Sheets("Destination_Sheet").Select Range("A2").select ' assumes column A is where you want the additional value If activecell.value = "" Then activecell.value = MyAdditionalValue Else If If activecell.value < "" and activecell.offset(1,0).value = "" Then activecell.offset(1,0).value = MyAdditionalValue Else Selection.End(xlDown).Select activecell.offset(1,0).value = MyAdditionalValue End if Hope this helps. Keith "tzam" wrote: Hello all. I had a question as to how to perform a certain task. I know how to record a Macro, but am not really sure how to get the results I want if possible. Here's the situation: I have a list of names in one sheet, followed by a checkmark. What I want to do is, when you click on the checkmark, I want that name transfered to another list in another sheet (same workbook). I understand how to do it if it takes the name and places it in another cell on the new workbook, but what if there is already something in that cell.? Is there a way to add it on the next line? Without deleating what was already there? Thanks in advance for the help! |
Macros, Excel 2000
Thanks!
I guess I should have re-worded my question a little better. I am not familiar with the coding in visual basic to be able to format this and get this to work the correct way. Because of the way users here at work are more familiar with Excel then any other program, I am trying to get this idea to work in Excel, but seems to be more trouble then it's worth. I have a list of around 100 people. I want to be able to click on something which then assignes them to a different location (different sheet). The only thing I could think of is that I would have to have around 5 "check boxes" (one for each location I am working with) that would take that name, and place it in a list on the desired destination sheet. The first issue was the 1st question I had; how to you add to a list if there is another name there. If you do a micro, it would perform that exact same task (place the name in the same destination cell) rather then to add it on the bottom of the list. Secondly, I would have to create around 500 micros (100 people, 5 locations) in order for this to work, correct? Seems like more then its worth unless someone else has a better idea! Thanks again for your help, it is WELL appreciated! "Keithlo" wrote: To edit a macro, choose Tools Macro Macros, select your macro, and press the edit button. This will open the Visual Basic Editor where you can edit your macro. Or you can simply open the Visual Basic Editor by choosing Tools Macro Visual Basic Editor. Then you would have to find your macro from the Project pane (upper left pane) by locating the Module it is in (if you recorded it, it is probably called Module1, or could be in another Module, like Module2, or Module3, depending how many times you re-recorded the macro in that file). All open files will be listed in the Project pane, with each file's sheets, forms, and Modules listed below each filename. I hope this helps. Keith "tzam" wrote: Thanks for the info. I am still not sure how to proceed with this. I know how to record a micro, but as far as editing it, I'm a newbie at that! Any additional help would be appreciated! "Keithlo" wrote: If you have a contiguous list of data in the destination sheet (no blank cells within the list), you can try this: Sheets("Destination_Sheet").Select Range("A2").select ' assumes column A is where you want the additional value If activecell.value = "" Then activecell.value = MyAdditionalValue Else If If activecell.value < "" and activecell.offset(1,0).value = "" Then activecell.offset(1,0).value = MyAdditionalValue Else Selection.End(xlDown).Select activecell.offset(1,0).value = MyAdditionalValue End if Hope this helps. Keith "tzam" wrote: Hello all. I had a question as to how to perform a certain task. I know how to record a Macro, but am not really sure how to get the results I want if possible. Here's the situation: I have a list of names in one sheet, followed by a checkmark. What I want to do is, when you click on the checkmark, I want that name transfered to another list in another sheet (same workbook). I understand how to do it if it takes the name and places it in another cell on the new workbook, but what if there is already something in that cell.? Is there a way to add it on the next line? Without deleating what was already there? Thanks in advance for the help! |
All times are GMT +1. The time now is 10:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com