LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Resize and a question

If anybody could help with this - I would so much appreciate it.

I import a csv file and the negative numbers have a trailing negative
sign. My process below will take the trailing negative sign and put it
where it should be - in front.

My problem is that the code below is only for the 10th column. I know
that I could write code that would repeat for the columns starting with
column 4 but it seems to me that a resize should work. Apparently I
have completely lost my capacity to use "resize".

Also - I think that I use the "myRange.Rows(i).cells.activate" and then
the replace part of the code must be causing me problems.

Please - I just don't get it.

As always - any help would be much appreciated.

Thanks in advance!
Anita


Dim dateInRow As Boolean
Application.ScreenUpdating = False
With ActiveSheet
Set myRange = .Cells(2, 10).Resize(.Cells(Rows.Count, _
1).End(xlUp).Row, 10)
For i = 1 To myRange.Rows.Count

For Each cell In myRange.Rows(i).Cells
If Right(Trim(cell.Value), 1) = "-" Then
myRange.Rows(i).Cells.Activate
ActiveCell.Replace What:="-", Replacement:="",
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Cells.Find(What:="-", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False) _
.Activate
myRange.Rows(i).Cells.Activate
ActiveCell.Value = "-" & ActiveCell.Value
Exit For
End If
Next cell
If Not dateInRow Then myRange.Rows(i).Hidden = False
Next i
End With
Application.ScreenUpdating = True
End Sub

 
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
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
Resize a cell comotoman Excel Discussion (Misc queries) 1 September 26th 05 04:30 PM
Resize name box Dave Peterson Setting up and Configuration of Excel 0 January 19th 05 01:01 AM
Need some help with Resize. Thanks John Wirt[_2_] Excel Programming 2 July 31st 03 08:37 AM


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