Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Output text from numbers

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Output text from numbers

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Output text from numbers

Thanks,

Unfortunately I cannot get this to run at all. I can't get any output from
it. Do i need to do something special to make this run?

Is VB the only way of doing this or is there a formula that would do this?

Thanks
LD

"Gary''s Student" wrote:

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Output text from numbers

For j = 2 To Columns.Count - for this line its saying compile error, invalid
outside procedure

I'm afraid VB is past me, so this means nothing for me. I tried doing F5 to
run and it came up with this error.

"LiAD" wrote:

Thanks,

Unfortunately I cannot get this to run at all. I can't get any output from
it. Do i need to do something special to make this run?

Is VB the only way of doing this or is there a formula that would do this?

Thanks
LD

"Gary''s Student" wrote:

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Output text from numbers

Worry not! Through persistence we will prevail. Begin by erasing the old macro

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Just make sure that your input table is located in the proper rows and
columns.
--
Gary''s Student - gsnu200819


"LiAD" wrote:

For j = 2 To Columns.Count - for this line its saying compile error, invalid
outside procedure

I'm afraid VB is past me, so this means nothing for me. I tried doing F5 to
run and it came up with this error.

"LiAD" wrote:

Thanks,

Unfortunately I cannot get this to run at all. I can't get any output from
it. Do i need to do something special to make this run?

Is VB the only way of doing this or is there a formula that would do this?

Thanks
LD

"Gary''s Student" wrote:

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Output text from numbers

Sounds simple...but unfortunately it doesn't work for me. Thats actually
what I did when i got the compile error. One thought I have a non english
computer so when i use excel i need to use ; instead of , in formulas. Could
this be a problem here?

"Gary''s Student" wrote:

Worry not! Through persistence we will prevail. Begin by erasing the old macro

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Just make sure that your input table is located in the proper rows and
columns.
--
Gary''s Student - gsnu200819


"LiAD" wrote:

For j = 2 To Columns.Count - for this line its saying compile error, invalid
outside procedure

I'm afraid VB is past me, so this means nothing for me. I tried doing F5 to
run and it came up with this error.

"LiAD" wrote:

Thanks,

Unfortunately I cannot get this to run at all. I can't get any output from
it. Do i need to do something special to make this run?

Is VB the only way of doing this or is there a formula that would do this?

Thanks
LD

"Gary''s Student" wrote:

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Output text from numbers

It might be a problem. I don't know.
--
Gary''s Student - gsnu200819


"LiAD" wrote:

Sounds simple...but unfortunately it doesn't work for me. Thats actually
what I did when i got the compile error. One thought I have a non english
computer so when i use excel i need to use ; instead of , in formulas. Could
this be a problem here?

"Gary''s Student" wrote:

Worry not! Through persistence we will prevail. Begin by erasing the old macro

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Just make sure that your input table is located in the proper rows and
columns.
--
Gary''s Student - gsnu200819


"LiAD" wrote:

For j = 2 To Columns.Count - for this line its saying compile error, invalid
outside procedure

I'm afraid VB is past me, so this means nothing for me. I tried doing F5 to
run and it came up with this error.

"LiAD" wrote:

Thanks,

Unfortunately I cannot get this to run at all. I can't get any output from
it. Do i need to do something special to make this run?

Is VB the only way of doing this or is there a formula that would do this?

Thanks
LD

"Gary''s Student" wrote:

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Output text from numbers

sorry stupid mistake on my part i was copying all the as well as the
routine.

works a lot better now!
thanks for your help

"Gary''s Student" wrote:

It might be a problem. I don't know.
--
Gary''s Student - gsnu200819


"LiAD" wrote:

Sounds simple...but unfortunately it doesn't work for me. Thats actually
what I did when i got the compile error. One thought I have a non english
computer so when i use excel i need to use ; instead of , in formulas. Could
this be a problem here?

"Gary''s Student" wrote:

Worry not! Through persistence we will prevail. Begin by erasing the old macro

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Just make sure that your input table is located in the proper rows and
columns.
--
Gary''s Student - gsnu200819


"LiAD" wrote:

For j = 2 To Columns.Count - for this line its saying compile error, invalid
outside procedure

I'm afraid VB is past me, so this means nothing for me. I tried doing F5 to
run and it came up with this error.

"LiAD" wrote:

Thanks,

Unfortunately I cannot get this to run at all. I can't get any output from
it. Do i need to do something special to make this run?

Is VB the only way of doing this or is there a formula that would do this?

Thanks
LD

"Gary''s Student" wrote:

This macro assumes the input table start in A1.
It continues until it finds 3 empties in a column in the table
The macro stores the output in row 4

Sub liad()
' gsnuxx
For j = 2 To Columns.Count
Set r = Range(Cells(1, j), Cells(3, j))
If Application.WorksheetFunction.CountA(r) = 0 Then
Exit Sub
End If
times = Application.WorksheetFunction.Max(r)
If Not IsEmpty(Cells(1, j)) Then simbol = "I"
If Not IsEmpty(Cells(2, j)) Then simbol = "E"
If Not IsEmpty(Cells(3, j)) Then simbol = "W"

If IsEmpty(Cells(4, 1)) Then
n = 1
Else
n = Cells(4, Columns.Count).End(xlToLeft).Column + 1
End If

For k = 1 To times
Cells(4, k + n - 1).Value = simbol
Next
Next
End Sub
--
Gary''s Student - gsnu200819


"LiAD" wrote:

I would like to find a way of getting excel to interpret numbers associated
with letters and output a text string. What I want to do is then use this
text string with a conditional format to provide a horizontal colour
sequence. Example below for how the table is required to output the text
string.

I 2 4
Input E 1 2
W 3

Output desired I I E W W W E E I I I
I

In any one column there will only be one number so excel needs to scan the
left most column first and repeat in a row in separate cells the number of
letters quoted in the table for that input. Then scan the second column and
output the letter x times in the next cell along etc.

Do you know if this is possible with Excel?

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
Why are numbers stored as text in my TOAD created Excel output? VK Excel Discussion (Misc queries) 1 June 6th 08 07:02 PM
Comparing cells and output text Rocketeer Excel Worksheet Functions 7 May 19th 08 12:14 AM
How to output text that blinks? ZHonorable Excel Discussion (Misc queries) 1 October 28th 06 10:24 AM
add text to end of formula output mgdarkman Excel Discussion (Misc queries) 2 December 9th 05 03:51 AM
Using a Text / Data output as a cell reference Jimboski Excel Discussion (Misc queries) 1 February 11th 05 07:31 PM


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