Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default '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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default '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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default '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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default '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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default '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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default '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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default '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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
Insert contents of various cells in a column into one cell? TextCells Excel Discussion (Misc queries) 1 April 2nd 06 10:41 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Insert contents of a cell into a title of a chart greg stenzel Charts and Charting in Excel 2 February 20th 05 11:19 PM
Insert new row as cell contents change George Excel Discussion (Misc queries) 2 January 26th 05 11:47 AM


All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"