Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cells(1,1).Text

No, there is not worksheet function beyond Text, but you would only have to
enter the format the first time you write the formula, then copy it down.
Doesn't seem that difficult. Also, processing hundreds of cells, even
thousands would take much less than a minute on a modern machine using a for
loop - so not sure what your concern is there either. If you are doing

activecell.offset(1,0).Select
Selection.Value = 3

kind of code, then either remove the select statements and join the code or
use

Application.ScreenUpdating = False ' at the start

Application.ScreenUpdating = True ' at the end

--
Regards,
Tom Ogilvy


"Dave Martin" wrote in message
...
Using Excel 2000.
Is there any way to use a Worksheet function in Excel that mimics the VBA
funtion Cells(1,1).Text?

The =TEXT function requires a format argument. All I want is the contents
of the cell in its currently displayed format. I have spent hours trying

to
concatenate two columns one of which is a date. Excel insists on

converting
the date into its underlying value (eg, 36721.3) when it concatenates with
the contents of another cell.

This is a piece of cake in VBA using the .Text function, but I have

several
hundred cells I need to concatenate, so going through a For/Next loop to
convert all these would be a time consuming step. Any ideas from you
Wizards out there would be greatly appreciated.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Cells(1,1).Text

I ran into several issues involving double quotation marks to go in the
=TEXT command. I finally came up with this awkward code. I don't know in
advance which of the two columns have the dates, so I check both. This
works but is roundabout.

Form_A = Temp_Sh.[A1].NumberFormat
Form_B = Temp_Sh.[B1].NumberFormat
Temp_Sh.[H:I].ClearContents
'Convert dates to text strings
If LCase(Form_A) < "general" Then
Temp_Sh.Range("I1:I" & lx).Value = Form_A
With Temp_Sh
With .[H1]
.FormulaR1C1 = "=TEXT(RC1,RC9)"
.Copy Temp_Sh.Range("H2:H" & lx)
End With
.Calculate
.Range("H1:H" & lx).Copy
.[A1].PasteSpecial (xlValues)
End With
End If
Temp_Sh.[H:I].ClearContents
' Same thing for COl B
If LCase(Form_B) < "general" Then
With Temp_Sh
With .[H1]
.FormulaR1C1 = "=TEXT(RC2," & "" & Form_B & "" & ")"
.Copy Temp_Sh.Range("H2:H" & lx)
End With
.Calculate
.Range("H1:H" & lx).Copy
.[B1].PasteSpecial (xlValues)
End With
End If
Temp_Sh.[H:I].ClearContents
'Get Concatenated ID plus ID2, copy the ID's and data into Scatter Data
sheet
With Temp_Sh
With .[H1]
.FormulaR1C1 = "=IF(RC1<RC2,RC1&"" ""&RC2,RC1)"
.Copy Temp_Sh.Range("H2:H" & lx)
End With
.Calculate
.Range("H1:H" & lx).Copy
.[H1].PasteSpecial (xlValues)
End With

"Tom Ogilvy" wrote in message
...
No, there is not worksheet function beyond Text, but you would only have

to
enter the format the first time you write the formula, then copy it down.
Doesn't seem that difficult. Also, processing hundreds of cells, even
thousands would take much less than a minute on a modern machine using a

for
loop - so not sure what your concern is there either. If you are doing

activecell.offset(1,0).Select
Selection.Value = 3

kind of code, then either remove the select statements and join the code

or
use

Application.ScreenUpdating = False ' at the start

Application.ScreenUpdating = True ' at the end

--
Regards,
Tom Ogilvy


"Dave Martin" wrote in message
...
Using Excel 2000.
Is there any way to use a Worksheet function in Excel that mimics the

VBA
funtion Cells(1,1).Text?

The =TEXT function requires a format argument. All I want is the

contents
of the cell in its currently displayed format. I have spent hours

trying
to
concatenate two columns one of which is a date. Excel insists on

converting
the date into its underlying value (eg, 36721.3) when it concatenates

with
the contents of another cell.

This is a piece of cake in VBA using the .Text function, but I have

several
hundred cells I need to concatenate, so going through a For/Next loop to
convert all these would be a time consuming step. Any ideas from you
Wizards out there would be greatly appreciated.






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
Count single Text in cells with multiple text entries WSC Excel Discussion (Misc queries) 6 January 9th 07 04:17 PM
merged cells into one text cell, size varies dependant on text dat Jazzylady825 Excel Discussion (Misc queries) 0 December 9th 05 08:26 PM
In Excel, option to enter text in cells the same as text boxes RobGMU Excel Worksheet Functions 0 October 26th 05 04:20 PM
Text shown up in other cells everytime a text is entered in 1 cell bioyyy Excel Discussion (Misc queries) 1 August 26th 05 05:26 PM
How to input additional text to multiple of existing cells that has text [email protected] Excel Worksheet Functions 2 June 21st 05 01:46 AM


All times are GMT +1. The time now is 09:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"