Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell not e
I would like to create a macro that sends the contents of a cell to another
cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell not e
Merry Christmas to you too!
Sub CheckCell() If Range("A2").Value = "" Then Range("A2").Value = Range("C2").Value Else Range("A3").Value = Range("C2").Value End If End Sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Gryndar" wrote: I would like to create a macro that sends the contents of a cell to another cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell n
That works great but after looking at my sheet I have a different problem
now, too many macros. I have 16 buttons per row (numbered 1 thru 16) and 32 rows (512 macros). It is a draw your partner tournament sign-up sheet for my local foosball tournament. Is it possible to have a macro that copies the contents of the cell, 'adjacent' to the left of the button selected, to the target cell or alternate cell if target cell is not blank, and to assign the same macro to same number button on each row? *(From adjacent cell "A2" [in this case selecting button 1] to E2 or E3 and next row would be, (button 1 selected), from A3 to E2 or E3 etc... [button 2 would go to E4 or E5 etc...). Hopefully this would give me 16 macros with 32 (number "1") buttons assigned to each macro. "Luke M" wrote: Merry Christmas to you too! Sub CheckCell() If Range("A2").Value = "" Then Range("A2").Value = Range("C2").Value Else Range("A3").Value = Range("C2").Value End If End Sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Gryndar" wrote: I would like to create a macro that sends the contents of a cell to another cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell n
Maybe it would be easier to put buttons in same cell as info and just widen
cell to fit buttons. Then I just need a macro to do same as below but from "Same Cell" instead of "Adjacent Cell". "Gryndar" wrote: That works great but after looking at my sheet I have a different problem now, too many macros. I have 16 buttons per row (numbered 1 thru 16) and 32 rows (512 macros). It is a draw your partner tournament sign-up sheet for my local foosball tournament. Is it possible to have a macro that copies the contents of the cell, 'adjacent' to the left of the button selected, to the target cell or alternate cell if target cell is not blank, and to assign the same macro to same number button on each row? *(From adjacent cell "A2" [in this case selecting button 1] to E2 or E3 and next row would be, (button 1 selected), from A3 to E2 or E3 etc... [button 2 would go to E4 or E5 etc...). Hopefully this would give me 16 macros with 32 (number "1") buttons assigned to each macro. "Luke M" wrote: Merry Christmas to you too! Sub CheckCell() If Range("A2").Value = "" Then Range("A2").Value = Range("C2").Value Else Range("A3").Value = Range("C2").Value End If End Sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Gryndar" wrote: I would like to create a macro that sends the contents of a cell to another cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell not e
Sub findbottom_paste()
Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) Range("C2").Copy Destination:=rng1 End Sub Or alternative..................... Sub findbottom_paste() Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) rng1.Value = Range("C2").Value End Sub Will keep moving down one cell each time you run the macro, copying C2 to next empty cell in column A Gord Dibben MS Excel MVP On Fri, 19 Dec 2008 09:02:04 -0800, Gryndar wrote: I would like to create a macro that sends the contents of a cell to another cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell n
Maybe I'm doing something wrong but neither formula will do anything. I am
just slitely better than a novice at this. The original formula worked the way I needed it to but using that formula will require 512 separate macros. I think if you see the sheet you would understand what I am trying to do. I can e-mail the sheet with all macros removed so you can see what I am talking about. I have modified the original sheet to show the buttons in the same cell as the players name to be assigned. "Gord Dibben" wrote: Sub findbottom_paste() Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) Range("C2").Copy Destination:=rng1 End Sub Or alternative..................... Sub findbottom_paste() Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) rng1.Value = Range("C2").Value End Sub Will keep moving down one cell each time you run the macro, copying C2 to next empty cell in column A Gord Dibben MS Excel MVP On Fri, 19 Dec 2008 09:02:04 -0800, Gryndar wrote: I would like to create a macro that sends the contents of a cell to another cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
'IF' Macro to insert cell contents to alternate cell if cell n
Maybe you just need to change Range("C2") to Activecell
Sub findbottom_paste() Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) Activecell.Copy Destination:=rng1 End Sub Or maybe some event code would be better. Can't tell. OK. Email me the workbook with an explanation of your needs. Change the AT and DOT in my email address. Or upload it to http://www.savefile.com/ then post the URL you will be given after you upload the file. Gord On Fri, 19 Dec 2008 15:41:03 -0800, Gryndar wrote: Maybe I'm doing something wrong but neither formula will do anything. I am just slitely better than a novice at this. The original formula worked the way I needed it to but using that formula will require 512 separate macros. I think if you see the sheet you would understand what I am trying to do. I can e-mail the sheet with all macros removed so you can see what I am talking about. I have modified the original sheet to show the buttons in the same cell as the players name to be assigned. "Gord Dibben" wrote: Sub findbottom_paste() Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) Range("C2").Copy Destination:=rng1 End Sub Or alternative..................... Sub findbottom_paste() Set rng1 = ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _ .Offset(1, 0) rng1.Value = Range("C2").Value End Sub Will keep moving down one cell each time you run the macro, copying C2 to next empty cell in column A Gord Dibben MS Excel MVP On Fri, 19 Dec 2008 09:02:04 -0800, Gryndar wrote: I would like to create a macro that sends the contents of a cell to another cell when a particular button is sellected but if that cell already has content to then send the info to an alternate cell. *(Click on button 1 to send contents of C2 to cell A2 but if A2 is not empty to send contents to A3) I have used ya'll (yes I am southern) several times before for macro info and have received great responses. Thanks a bunch in advance. MERRY CHRISTMAS EVERYONE! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to move part of cell contents to another cell | Excel Discussion (Misc queries) | |||
Insert contents of various cells in a column into one cell? | Excel Discussion (Misc queries) | |||
Macro to remove contents of cell and move all other contents up one row | Excel Discussion (Misc queries) | |||
Insert contents of a cell into a title of a chart | Charts and Charting in Excel | |||
Insert new row as cell contents change | Excel Discussion (Misc queries) |