Copy contents of one cell into another if cell is blank

How do I copy the contents of cell B2 into cell D2 if D2 is empty
0
Utf
1/8/2010 4:13:02 PM
excel.worksheet.functions 4936 articles. 2 followers. Follow

2 Replies
2667 Views

Similar Articles

[PageSpeed] 41

Select Cell B2, Edit > Copy, select cell D2, Edit > Paste Special > Values > OK

-- 
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"fire9990" wrote:

> How do I copy the contents of cell B2 into cell D2 if D2 is empty
0
Utf
1/8/2010 4:25:02 PM
Copy/paste manually.

Or run a macro.

Sub qwert()
    With ActiveSheet.Range("D2")
        If .Value = "" Then
            .Value = Range("B2").Value
        End If
    End With
End Sub


Gord Dibben  MS Excel MVP

On Fri, 8 Jan 2010 08:13:02 -0800, fire9990
<fire9990@discussions.microsoft.com> wrote:

>How do I copy the contents of cell B2 into cell D2 if D2 is empty

0
Gord
1/8/2010 4:54:13 PM
Reply:

Similar Artilces:

How can i move a macro from one computer to another
i would like to move a macro from one computer to another i Excel Macros live in excel workbooks. So you can just copy that workbook with the macro to the other pc and open it there. TorToms wrote: > > i would like to move a macro from one computer to another i Excel -- Dave Peterson ec35720@msn.com Or you could export the module containing the macro as a *.BAS file, email it to other computer then import to another workbook. Gord Dibben Excel MVP On Wed, 08 Sep 2004 07:05:48 -0500, Dave Peterson <ec35720@msn.com> wrote: >Macros live in excel workbooks. > >So ...

Can't display all text in cell
I'm trying to display text in a cell. I've got Wrap Text on, and I hav several paragraphs of text. All of it appears in the formula bar, bu not in the cell displayed on the screen. And yes, I increased the ro height, but it still doesn't show. Any ideas? Thank -- Message posted from http://www.ExcelForum.com I am having the same problem. Apparantly there is a 1024 character limitation per cel in excel. The only advice I have received so far, which does work, is to press alt+enter to create a line break. If you find another work around, I would be interested. Hi besid...

Strange behavior when copying formula.
Hi, Here is what I'm trying to do. I want to show the summation of the first two rows' number in the third row. I use the summation function to get the first result. Then, I copy and paste the result to the other two, but they show the same results as the first one. I check the formula of all three results, and they are all correct and referring to the right cells. Why is that? 1 2 3 1 2 3 2 2 2 Leo Do you have Tools/Options/Calculation set to Manual? If so, click the Automatic button. In article <eE#EeXFhDHA.2512@TK2MSFTNGP09.phx.gbl>, "Leo Leon...

Export Access Record to Specific Cells in Excel
I'm looking for suggestions on how to export data from an Access table or Query into specific cells of a Worksheet. The table I'm importing will always contain a single record only. For example, I'd like to export data from Field1, field2...etc in an access table to Sheet2!A3, Sheet2!B3...etc. Any sugestions would be most appreciative. ...

Creating a summary page without blank lines
I have a project where I need to determine if the billing for supplemental charges for employees matches what is actually deducted from the employee's pay check. I just started this position and what I am working with is a separate spreadsheet for each month's bill. What I have done so far is to create a spreadsheet with a tab for each month that just has the supplemental information being billed for in the left most columns and what was deducted from each paycheck in the columns to the right, a tab that lists employee names and employee numbers, and a summary page that lists...

Soft copy of training material
Hi all, I have completed the class room training of CRM 3.0 Installatio and Customization. I also got the printed training material. But soetimes, searching something in the book becomes very difficult. Can I have the soft copy of these training manuals? Does Microsoft provides it? We are Gold certified partners btw. If anybody has some idea about this, please let me know. Thanks, -Imran https://dynamics.microsoftelearning.com/eLearning should find everything from your course in the eLearning Courses (or at least, I'd presume so). Either way, the online courses are a handy thing ...

Conditional Formatting
I have a row of cells that calculate the totals for their columns but I force to be blank via IF statements until certain conditions are met. Once these conditions are met, the total appears. I'd like to also highlight these total cells via conditional formatting. My conditional formatting input is simply "If Cell is Greater than 0, format". For some reason all the cells format as though they are all > 0 yet they don't display anything. Are there some internal rules that specifiy when a cell is really 0? Is there another way to do this that won't care what the for...

Multiple mfc activex controls in one dll
In VS6, there was a possibility to define up to 4 controls, when creating a new activex project. No such possibility in VS2005. Is there any way in 2005 to add an addtional one to an existing MFC ActiveX project? Any pointers will be appreciated! ...

HTML now shown as a blank page
I have just accidentally sent all my inbox items to Outlook Express. I have exported them all back to Outlook 2000 (My Default Mail Server) but they are all marked as unread and all the mails that were HTML just show a blank screen. Can anyone please help?? Thanks in Advance Mark ...

counting same text from different cells
Hi I was Trying to count text such as "p" for pass from different cell in excel but i am not sure what is the formula for that. It will be really helpful if u could send me the solution thank you om Hi =COUNTIF(A1:A100,"p") -- Regards Frank Kabel Frankfurt, Germany "om" <om@discussions.microsoft.com> schrieb im Newsbeitrag news:96B25715-6B88-40F8-8360-9602A05E3B30@microsoft.com... > Hi I was Trying to count text such as "p" for pass from different cell in > excel but i am not sure what is the formula for that. > > It will be rea...

pulling cell "value"
in the cell C4 i have the formula =now() and I have that cell formatted to custom mmmm so that it displays as January. I am now trying to write some VBA code to look at cell C4 and take the January and then do a vlookup on the array that i have named months. months is the cells D14:E25 column D has a list of the months and column E has a list of numbers that corresponds to these months. This is a custom list so I can not use the standard numbers that excel uses for the months. The vlookup in vba should take the January and find the number in col E that corresponds to it th...

Formatting Cells #13
If you want something from cell (A) to appear in cell (B) and change when the contents of cell A changes, how do I do that? Acurran, =A1 ??? -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2000 & 2003 ** remove news from my email address to reply by email ** "Acurran" <Acurran@discussions.microsoft.com> wrote in message news:E800CB99-E6BA-4DF3-BCA0-445A89B2E8A8@microsoft.com... > If you want something from cell (A) to appear i...

Software copy-protection strategies involving unlock codes
I would like to learn about strategies for protecting my software against illicit copying, by supplying users with unlock codes which they have to use to unlock the program's full functionality. Does anyone know of any good books on this topic, or other sources of information on it. TIA Simon I don't, although I've done a bit of work in this area myself. The first issue you need to deal with is how to stop a customer that has the code from being able to give it to someone else. I simply have the code tied to the customers name and company, if any. This way, they can st...

Highlighting a cell
I would like to highlight a cell for data entry, but I do not want the color to print. Is there a way to acheive this in Excel 2000. Thanks Sandi <File>, <PageSetup>, <Sheet>tab, Under Print, check the "Black & White" box. HTH, RD ==================================================== Please keep all correspondence within the NewsGroup, so that all may benefit! ==================================================== "Sandi" <ssteines@abprocess.com> wrote in message news:00c601c376eb$2b9a9910$a301280a@phx.gbl... I would like to highlight a ce...

Hard return in wraptext cell?
Is there a way to place a hard return(carriage return) in a cell with wrap text format so as to align text in the way user wants rather than what excel places? Thanks Mark Sure. Where you want a new line just press Alt+Enter. To remove that just place the cursor at the end of the line before the new line and press Delete Tyro "MP" <NoSpam@Thanks.com> wrote in message news:OAFfO3vVIHA.4880@TK2MSFTNGP03.phx.gbl... > Is there a way to place a hard return(carriage return) in a cell with wrap > text format > so as to align text in the way user wants rather than wh...

in MS EXCLE how we can protect only one cell?
plz do repl me soon Hi First select all of the cells in the Sheet>Format>Cells>Protection>remove the check mark form Locked. Next select the single cell you want to be locked>Format>Cells>protection>check Locked. Tools>Protection>Protect Sheet (optionally provide a password - remember to write it down somewhere of you do) -- Regards Roger Govier anu khan wrote: > plz do repl me soon EXCEL 2007 This assumes that you wish to protect cells D 83 to D 85. If you wish to protect just one cell replace D 83 to D 85 (below) with the cell ...

Blank pages #2
My worksheet has 47 pages, but only data on 9 pages. In print preview it's showing hundreds of empty rows. I have deleted them, saved, closed the file, but they are still there. How do I get this crazy thing to print down to the last row where there is data, and no further? I don't want to set the print area because then I have to reset it everytime I add more rows of data. Thank you Connie Mississauga, Canada If you didn't delete the rows using the row number on the left, try that. Be sure and save. I have heard that one some versions you had to leave quit Excel and co...

Selecting Cells with Shift Key
When I am selecting cells in Excell, I use the shift key and the arrows on my keyboard. If I pause at all, the selection is lost when I continue with the selection. Why? Can anyone help me? If you have removed your finger from the shift key then Windows will think you are starting a new selection. Just be sure that you don't touch the arrows without the shift being held down. LWhite "Jaymndad" <Jaymndad@discussions.microsoft.com> wrote in message news:961E850D-AFAD-444C-AB81-F4A609BCB3BA@microsoft.com... > When I am selecting cells in Excell, I use the shift key...

Merge Cells, but keep backgrounds
In excell 2003 is there a way to merge cells so the text spans them all, but keep the current background of the cells (which are not all the same color)? No Try Center Across Selection and avoid merged cells whenever possible. Gord Dibben MS Excel MVP On Sat, 30 May 2009 09:16:12 -0700 (PDT), "dan@danirwin.net" <dan@danirwin.net> wrote: >In excell 2003 is there a way to merge cells so the text spans them >all, but keep the current background of the cells (which are not all >the same color)? Is there a way to center across selection vertically or just horizonta...

Data Entry to a Cell Range
Can I set up a data entry form, so if every time I enter a value in a cell, it updates the next empty cell in a range? Thanks Lets assume that the form is used to update cell A1. We require that everytime A1 is updated the new value will be recorded in column B. Put the following event macro in the worksheet code area: Private Sub Worksheet_Change(ByVal Target As Range) Dim A1 As Range, t As Range Set A1 = Range("A1") Set t = Target If Intersect(A1, t) Is Nothing Then Exit Sub Application.EnableEvents = False n = Cells(Rows.Count, "B").End(xlUp).Row...

alter the content of the from box in a message
in outlook my "from" box automatically defaults to the email from me and that is the email address issued to me by my ISP that I entered at inception. I want my default email to read a different email which corresponds not to my ISP but to my web site and email service by my web hosters? for example my outlook says that my emails are from blanchard@btinternet.com in my signature block i type my small company details and include my company website and my email which is mail@blanchardcon.com etc how do i get this email to appear as a default in the "from" box? Enter i...

How set totals of various cells with per colour fill value?
I have a sheet containing values as follows. April May June company 1 43 company 2 5 company 3 17 The cell values are also coured to indice a status. Somewhere beside the table I want to mention the totals of the cells, per status (so per colour). How to perform the latter? Thank you. Bart Excell 2003 See http://www.xldynamic.com/source/xld.ColourCounter.html for a working solution -- HTH Bob Phillips (remove xxx from email address if mailing direct) "AA Arens" <bartvandongen@gmail.com> wrote in mes...

Mail forwarding to another server
Hi, Is there any way to forward all mails for a particular user from exchange server to another mail server. Any help would be great. Thanks and regards, Shammy. Hi Create a contact with the external address of the user then on the users account in Active Directory User & Computers | Exchange General | Delivery Options | Forward to: click modify and point to your newly created contact. Regards -- Ben Hoffman MVP Exchange http://www.exchangeis.com "SHAMMY" <SHAMMY@discussions.microsoft.com> wrote in message news:170FE8CA-1780-484F-B9C3-377669F5732C@microsoft.com... ...

Copy Posts from one Public Folder to Another
I have an Exchange 2003 Public folder tree that has multiple levels. I have a need for users to Post to one public folder and then have a copy of that Post copied to another public folder automatically. I have set this up for emails (plain forwarding) and it works fine but I have yet been able to get the Posts to duplicate to the other folder. Does anyone have any ideas? Your help is greatly appreciated. Thanks Glenn There are two ways to forward email out of a public folder: 1. Used a rule on the public folder. As owner of the public folder go to properties and to the folder assistant ...

Page Breaks on cells
It pops up with putting a page break for every cell then when I am trying to reset them it tells me margins do fit and that it would take it to less than 10% minumum if I try to move them. Jo - Did you ever get an answer to this? I am having the same problem, and it is on a 30-tab workbook that I can't just re-created. I'm getting a page for every cell when I move the page breaks and they used to be fine! Help! :) "Jo Pratt" wrote: > It pops up with putting a page break for every cell then > when I am trying to reset them it tells me margins do fit > and...