ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to re-write all cells in a column (https://www.excelbanter.com/excel-programming/306564-re-macro-re-write-all-cells-column.html)

sp00nix[_21_]

Macro to re-write all cells in a column
 
rewrite to where? more info please...


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


Bob L[_5_]

Macro to re-write all cells in a column
 
rewrite in the same cell.

I tried the following

Sub RewriteColumn()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Set isect = Intersect(Columns(ActiveCell.Column), ActiveSheet.UsedRange)
If isect Is Nothing Then
MsgBox "This is an empty column!"
Exit Sub
End If

For Each cel In isect
valu = cel.Value
cel.FormulaR1C1 = valu
Next cel

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub


"sp00nix " wrote:

rewrite to where? more info please...


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



Tom Ogilvy

Macro to re-write all cells in a column
 
That worked fine for me. What is the problem?

--
Regards,
Tom Ogilvy

"Bob L" wrote in message
...
rewrite in the same cell.

I tried the following

Sub RewriteColumn()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Set isect = Intersect(Columns(ActiveCell.Column),

ActiveSheet.UsedRange)
If isect Is Nothing Then
MsgBox "This is an empty column!"
Exit Sub
End If

For Each cel In isect
valu = cel.Value
cel.FormulaR1C1 = valu
Next cel

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub


"sp00nix " wrote:

rewrite to where? more info please...


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





Bob L[_5_]

Macro to re-write all cells in a column
 
It doesn't seem to rewrite, I have over 9500 cells and it doesn't seem to work


"Tom Ogilvy" wrote:

That worked fine for me. What is the problem?

--
Regards,
Tom Ogilvy

"Bob L" wrote in message
...
rewrite in the same cell.

I tried the following

Sub RewriteColumn()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Set isect = Intersect(Columns(ActiveCell.Column),

ActiveSheet.UsedRange)
If isect Is Nothing Then
MsgBox "This is an empty column!"
Exit Sub
End If

For Each cel In isect
valu = cel.Value
cel.FormulaR1C1 = valu
Next cel

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub


"sp00nix " wrote:

rewrite to where? more info please...


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






Tom Ogilvy

Macro to re-write all cells in a column
 
Run this version

Sub RewriteColumn()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Set isect = Intersect(Columns(ActiveCell.Column), ActiveSheet.UsedRange)
If isect Is Nothing Then
MsgBox "This is an empty column!"
Exit Sub
End If

For Each cel In isect
if cel.row mod 500 = 0 then _
msgbox "processing Cell " & cell.Address
valu = cel.Value
cel.FormulaR1C1 = valu
Next cel

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub

--
Regards,
Tom Ogilvy



"Bob L" wrote in message
...
It doesn't seem to rewrite, I have over 9500 cells and it doesn't seem to

work


"Tom Ogilvy" wrote:

That worked fine for me. What is the problem?

--
Regards,
Tom Ogilvy

"Bob L" wrote in message
...
rewrite in the same cell.

I tried the following

Sub RewriteColumn()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Set isect = Intersect(Columns(ActiveCell.Column),

ActiveSheet.UsedRange)
If isect Is Nothing Then
MsgBox "This is an empty column!"
Exit Sub
End If

For Each cel In isect
valu = cel.Value
cel.FormulaR1C1 = valu
Next cel

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

End Sub


"sp00nix " wrote:

rewrite to where? more info please...


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









All times are GMT +1. The time now is 01:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com