Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default repost: convert +/- on text value

Hi ng.
All apologies for the re-post

Using xl xp pro
Would like to change value in col c neg/pos or pos/neg
If condition is true in col b
Col b should be tested for "sales" or "opc" (w/o ""'s)
If criteria is not satisfied, value in c shold be left as is.

I condition is satisfied by col b adjacent cell in col c
Should have reverse sign (+/-)

Ex:
=================================================
Begin Data-
A B C
1 Sales 90500

End Data-
A B C
1 Sales -90500
=================================================

"Sales" encountered in col b so adjacent cell col c, converted to neg

Prefer VBA if possbile so store in "personal.xls" in xlstart
This code would have multiple applications for me.

tia
goss


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default repost: convert +/- on text value

Sub ChangeSign()

Dim c As Range
For Each c In
ActiveSheet.Range("C2:C65000").SpecialCells(xlCell TypeConstants)
If c.Offset(0, -1).Value = "Sales" Then c.Value = c.Value * -1
Next c
Set c = Nothing

End Sub

--
Dianne

In ,
goss typed:
Hi ng.
All apologies for the re-post

Using xl xp pro
Would like to change value in col c neg/pos or pos/neg
If condition is true in col b
Col b should be tested for "sales" or "opc" (w/o ""'s)
If criteria is not satisfied, value in c shold be left as is.

I condition is satisfied by col b adjacent cell in col c
Should have reverse sign (+/-)

Ex:
=================================================
Begin Data-
A B C
1 Sales 90500

End Data-
A B C
1 Sales -90500
=================================================

"Sales" encountered in col b so adjacent cell col c, converted to neg

Prefer VBA if possbile so store in "personal.xls" in xlstart
This code would have multiple applications for me.

tia
goss



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
Had to repost it!!! Prashant Excel Discussion (Misc queries) 1 April 23rd 10 03:19 PM
Repost! Richard Excel Discussion (Misc queries) 1 September 26th 09 01:10 PM
How do i convert diagonal text into horizontal text Alexander Excel Worksheet Functions 0 July 15th 08 07:02 PM
How do I convert a text array to a concatenated text cell? Excel. Vargasjc Excel Worksheet Functions 5 December 20th 06 06:35 PM
convert a range of lowercase text to upper text or vice versa jackdaw Excel Worksheet Functions 2 May 16th 05 09:31 PM


All times are GMT +1. The time now is 08:52 PM.

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"