Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help - This macro converts my text numbers.

What would I have to do, to change the code so the numbers that ge
copied keep their original text format? This is a great macr
(something given to me on this Forum) however it converts my number
from a text to a general format... and I lost my leading zeros...

Sub TidyUp()
Dim cLastRow As Long
Dim rng As Range
Dim i As Long
cLastRow = Cells(Rows.Count, "C").End(xlUp).Row
For i = 2 To cLastRow
If Cells(i, "A").Value = "" Then
Cells(i, "A").Value = Cells(i - 1, "A").Value
Cells(i, "B").Value = Cells(i - 1, "B").Value
End If
Next i

End Su

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help - This macro converts my text numbers.

Try this:

Sub Fillblanks1()
Dim rng As Range, rng1 As Range
Set rng = Intersect(ActiveSheet.UsedRange, _
ActiveSheet.Columns(1).Resize(, 2))
Set rng1 = rng.SpecialCells(xlBlanks)
For Each ar In rng1.Areas
ar.Offset(-1, 0).Resize(ar.Rows.Count + 1).FillDown
Next
End Sub

--
Regards,
Tom Ogilvy

"jer101 " wrote in message
...
What would I have to do, to change the code so the numbers that get
copied keep their original text format? This is a great macro
(something given to me on this Forum) however it converts my numbers
from a text to a general format... and I lost my leading zeros...

Sub TidyUp()
Dim cLastRow As Long
Dim rng As Range
Dim i As Long
cLastRow = Cells(Rows.Count, "C").End(xlUp).Row
For i = 2 To cLastRow
If Cells(i, "A").Value = "" Then
Cells(i, "A").Value = Cells(i - 1, "A").Value
Cells(i, "B").Value = Cells(i - 1, "B").Value
End If
Next i

End Sub


---
Message posted from http://www.ExcelForum.com/



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
opening text file converts numbers to scientific notation Ken Clark Excel Discussion (Misc queries) 1 March 22nd 10 06:37 AM
Create a key that converts numbers to words? OfficeMaven Excel Discussion (Misc queries) 1 January 9th 08 07:31 PM
Macro that converts xls to csv Carl Excel Worksheet Functions 0 January 26th 07 04:45 PM
transposing an array converts dates into numbers Mehmet Excel Worksheet Functions 3 April 21st 06 07:04 AM
converts numbers to dates jason2444 Excel Discussion (Misc queries) 2 February 10th 06 10:38 PM


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