Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill variable number of cells with a fixed text
Hi All,
I am struggling with the following: I've created a VBA statement that compiles a certain file using different input sheets. At some point I want to add a fixed description in column B in case there is a value in column A To make it a bit more visible: A B (to be covered by a VBA statement) 1 EUR Fx Forward 2 GBP Fx Forward 3 USD Fx Forward 4 CHF Fx Forward 5 SGD Fx Forward Note: the number of cells in column A varies through time Can someone perhaps tell me which statement I can use best? Many thanks in advance! Rgds, Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill variable number of cells with a fixed text
Try something like
Sub AAA() Dim RowNdx As Long Dim StartRow As Long Dim EndRow As Long StartRow = 1 '<<< CHANGE IF NEEDED EndRow = Cells(Rows.Count, "A").End(xlUp).Row For RowNdx = StartRow To EndRow If Cells(RowNdx, "A").Value < vbNullString Then Cells(RowNdx, "B").Value = "ABCD" End If Next RowNdx End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Robert" wrote in message oups.com... Hi All, I am struggling with the following: I've created a VBA statement that compiles a certain file using different input sheets. At some point I want to add a fixed description in column B in case there is a value in column A To make it a bit more visible: A B (to be covered by a VBA statement) 1 EUR Fx Forward 2 GBP Fx Forward 3 USD Fx Forward 4 CHF Fx Forward 5 SGD Fx Forward Note: the number of cells in column A varies through time Can someone perhaps tell me which statement I can use best? Many thanks in advance! Rgds, Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replace a fixed number with a variable via popup | Excel Worksheet Functions | |||
How fill series containing one variable and one fixed value in XL | Excel Discussion (Misc queries) | |||
Macro - Fixed text code needs replacing with variable text | Excel Discussion (Misc queries) | |||
percent of a fixed and variable number | Excel Discussion (Misc queries) | |||
How do I assign a fixed number value to text? | Excel Discussion (Misc queries) |