Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
Replace a fixed number with a variable via popup Colin Hayes Excel Worksheet Functions 3 August 16th 11 08:42 PM
How fill series containing one variable and one fixed value in XL nomad Excel Discussion (Misc queries) 2 September 18th 09 09:25 PM
Macro - Fixed text code needs replacing with variable text steven.holloway Excel Discussion (Misc queries) 3 July 22nd 08 03:57 PM
percent of a fixed and variable number Lorne Excel Discussion (Misc queries) 7 June 8th 08 08:43 PM
How do I assign a fixed number value to text? GooseGirl Excel Discussion (Misc queries) 5 August 19th 07 09:43 PM


All times are GMT +1. The time now is 12:16 AM.

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"