Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hope you can help, need to move a value in one cell to another only IF the
first cell is not empty. In a function it would be: in cell B2 - - - - =IF(C2="","",C2) What I have now: Col1 Col2 AAA BBB CCC What I would like to end up with: Col1 Col2 AAA AAA BBB BBB CCC CCC Thanks in advance! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You already have the formula. What is the problem?
Glen |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Problem is, I need it in VBA instead of a function.
" wrote: You already have the formula. What is the problem? Glen |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You could use a loop...see below Sub Loop() On Error Resume Next Dim r As Variant Dim WSN As Variant Set WSN = Thisworkbook.Sheets("Sheet1") 'put the sheet name here r = 1 Do If WSN.Cells(r, 1).Value = "" Then r = r + 1 Else: WSN.Cells(r, 2).Value = WSN.Cells(r, 1) r = r + 1 End If Loop End Sub This would do what you want...If you need more help, let me know... Scott Wagner Wrote: Hope you can help, need to move a value in one cell to another only IF the first cell is not empty. In a function it would be: in cell B2 - - - - =IF(C2="","",C2) What I have now: Col1 Col2 AAA BBB CCC What I would like to end up with: Col1 Col2 AAA AAA BBB BBB CCC CCC Thanks in advance! -- dok112 ------------------------------------------------------------------------ dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581 View this thread: http://www.excelforum.com/showthread...hreadid=513802 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to do this where I can be more specific?
Say only look at column F, and copy values to column D. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to remove contents of cell and move all other contents up one row | Excel Discussion (Misc queries) | |||
Macro to copy contents in current row to Sheet2 | Excel Programming | |||
Macro to copy cell contents number of columns | Excel Programming | |||
Using VB copy contents of a macro to workbook | Excel Programming | |||
Copy cell contents into Macro code | Excel Programming |