Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input specific value into cell if Row has data
Hi there,
I have a worksheet ("Results") that has several rows of data - in specific columns. I now need to add a specific value into the blank columns of these rows of data: Befo A B C D E 1 coke 24 xxx 2 coke 18 xxx After A B C D E 1 coke TRUE 24 xxx 2 coke TRUE 18 xxx The specific value will be the same on every row. I am able to add this value to every line regardless of whether there is data in that row, however, I ideally only want it when there is data in row. Can someone help me please? If I have been unclear, I will be more than willing to provide more information should it be required. Regards |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input specific value into cell if Row has data
Hi,
If I didn't misunderstand this formula should work =IF(COUNTA(C8:E8)0,"TRUE","") if any of the cells in the row have data will enter True otherwise will be blank "PVANS" wrote: Hi there, I have a worksheet ("Results") that has several rows of data - in specific columns. I now need to add a specific value into the blank columns of these rows of data: Befo A B C D E 1 coke 24 xxx 2 coke 18 xxx After A B C D E 1 coke TRUE 24 xxx 2 coke TRUE 18 xxx The specific value will be the same on every row. I am able to add this value to every line regardless of whether there is data in that row, however, I ideally only want it when there is data in row. Can someone help me please? If I have been unclear, I will be more than willing to provide more information should it be required. Regards |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input specific value into cell if Row has data
Try this:
Sub PutValue() Dim specific As String Dim columnn As String Dim n As Long, i As Long specific = "TRUE" columnn = "C" n = Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To n If Application.WorksheetFunction.CountA(Rows(i)) < 0 Then Cells(i, columnn).Value = specific End If Next End Sub -- Gary''s Student - gsnu201001 "PVANS" wrote: Hi there, I have a worksheet ("Results") that has several rows of data - in specific columns. I now need to add a specific value into the blank columns of these rows of data: Befo A B C D E 1 coke 24 xxx 2 coke 18 xxx After A B C D E 1 coke TRUE 24 xxx 2 coke TRUE 18 xxx The specific value will be the same on every row. I am able to add this value to every line regardless of whether there is data in that row, however, I ideally only want it when there is data in row. Can someone help me please? If I have been unclear, I will be more than willing to provide more information should it be required. Regards |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input specific value into cell if Row has data
I'm not completely clear on what you are looking to do. Is Column C the only
column that you want to put the word TRUE in or did you want to put that word into each blank cell on a row containing some data? Will any column (I'm thinking either A or B) always have data in them when the row contains data? -- Rick (MVP - Excel) "PVANS" wrote in message ... Hi there, I have a worksheet ("Results") that has several rows of data - in specific columns. I now need to add a specific value into the blank columns of these rows of data: Befo A B C D E 1 coke 24 xxx 2 coke 18 xxx After A B C D E 1 coke TRUE 24 xxx 2 coke TRUE 18 xxx The specific value will be the same on every row. I am able to add this value to every line regardless of whether there is data in that row, however, I ideally only want it when there is data in row. Can someone help me please? If I have been unclear, I will be more than willing to provide more information should it be required. Regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
data input into cell a1 drives c1 data gathered from a list | Charts and Charting in Excel | |||
Send data from userform to specific cell on specific sheet? | Excel Programming | |||
macro to input data on a specific date | Excel Programming | |||
data validation to restrict input in cell based on value of cell above that cell | Excel Programming | |||
How do I make a cell date specific to input a value on a specific. | Excel Discussion (Misc queries) |