How to copy data from one worksheet to another - excel

I want to copy some data from one cell in worksheet 1 to another cell in worksheet 2 if it meets some condition.
So I am using:
=IF(Sheet3!C49=0,"",Sheet3!C49)
where If cell C49 in sheet 3 has something in it then copy whatever is in cell C49 in sheet 3 into the cell that contains this formula.
This works perfectly for text but when I enter a date of 31/07/2009 in cell C49 then the cell with the above formula says 40025 (all dates give odd numbers). The whole of column C has dates in it.
When I enter an integer in cell C49 in sheet 3 (eg. 12), then cell C49 in sheet 3 says "12/01/1900" but the cell in the other worksheet which contains the above formula says 12.
What I want to do is copy the date from cell C49, sheet 3, into the cell with the above formula.
Can anyone help?

Have you tried formatting the column containing the funny number as Date? The funny number is Excel's serial representation of the date.
Alternatively if you just want the date as text you could use the function =TEXT(A1,"yyyyMMdd") etc...
If you wish to copy both the values and the formatting then you'll probably want to knock up a VBA macro.

Related

Excel - Look through value for a particular column and paste in another sheet

I have a column with cells value is either 1 or empty / 0
I want to loop through individual cell from B4 to B50 to check the value in this sheet called "Data".
If value is 1, then copy the cell content on the left (A4) to another sheet called "Main" at B2.
While copying, it need to check the cell (B2) is empty, if not, check next B3, B4 and paste to next empty cell.
Pasting into cell should retain the format of the words (e.g. Bold,italic, if there is) and colour of the cells that is copying from.
Then return to "Data" sheet and resume checkin for value 1. Loop until B50.
Appreciate using excel 2016 VBA. I tried a few type of codes but remain error.

How to modify a sheet column regarding another sheet column?

I have 2 excel sheets (Sheet1 and Sheet2).
In sheet1 I have a table, I want to modify the table regarding to the second sheet as shown in the image such that the column in table of sheet1 (column called needed) looksup values in sheet2 and if id(1) is found in colmn of id in sheet2 then the cell of this id should get the value that corresponds to the same id in sheet 2.
That is what I basically want, but I can't figure out how to do that in excel
On Sheet1 in cell D2 enter the following formula:
=VLOOKUP(A2;Sheet2!$A$2:$D$5;4;FALSE)
Note that you might need to change the semicolons ; to regular commas , depending on your version of Excel. Then just copy that cell down the entire column of the table.

copying excel cells one by one and not range at once

I'm developing some excel macros, and now I'm stucked with following,
I want the macro getting the cells from another file and put it on the new one but it is important to consider that copy the full range is not an option, so for example first i Need to copy a1 then a2 , etc ...
the reason is because after each "paste" process, I have to check, the old value and then start a triger of another macro depending on both values, and if ai paste the full range at once it is not working,.
Try getting the Cells value at given row and column from the Worksheet objects you are manipulating.
Example : I want to copye the value (cell content only, not style) from worksheet1 cell A1 to worksheet2 cell B3.
worksheet2.Cells(3, 2).Value = worksheet1.Cells(1, 1).Value
Simple as that.

How do I reference a cell in range of worksheets and look for a specific value in Excel?

Is this possible?
=IF(COUNTIF('**ALLSHEETS**'!D4, "ICT"),**SHEETNAME**, FALSE)
Excel will look up a a specific value ("ICT") in the same cell in every sheet then if that cell contains the value it will return the name of the sheet(s)
You can do it with a little trick
Put this Formula in Cell A1 of Everysheet you want to get searched
=IF(D4="ICT",MID(#CELL("filename",A1),FIND("]",#CELL("filename",A1))+1,255),"")
Then, in the required sheet!cell add all sheets like
=Sheet1!A1&Sheet2!A1&Sheet3!A1
Note: If it would be only one sheet having ICT and you are trying to find the sheet name, then this would be the easiest solution
But in case of multiple sheets having ICT in D4, the result would be a like
sheet1sheet2sheet3 in the same cell.

How to populate a cell in one sheet from a cell in the other using excel

I am trying to get a row of cell to populate from one sheet in the same workbook to another. I have sheet1 and sheet2. They are text fields. I did the formula =sheet1!A2. It works, but I get a 0 if there is not data in the copied cell (sheet1, A2). How can I get the zero to be null.
=if(sheet1!A2="","",sheet1!A2)
This should evaluate the cell contents and keep blank cells as blank cells. I assume you want cells with the number 0 in them to stay 0.

Resources