Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,276
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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
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
data input into cell a1 drives c1 data gathered from a list petlover Charts and Charting in Excel 0 June 11th 07 10:23 PM
Send data from userform to specific cell on specific sheet? JennLee Excel Programming 10 March 10th 07 02:55 AM
macro to input data on a specific date Ray Excel Programming 0 January 9th 06 02:48 AM
data validation to restrict input in cell based on value of cell above that cell NC Excel Programming 2 January 25th 05 07:11 AM
How do I make a cell date specific to input a value on a specific. ebuzz13 Excel Discussion (Misc queries) 1 January 18th 05 05:53 PM


All times are GMT +1. The time now is 06:26 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"