ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macros Problem (https://www.excelbanter.com/excel-discussion-misc-queries/158530-macros-problem.html)

Gary

Macros Problem
 
Hi, I run the following macro to convert columns E,G,H,I into Euro's but it
keeps converting coulmn D, which I don't won't to convert. Can anyone help.
Thanks

If Range("D7") = "EURO" Then
Range("E:E,G:G,H:H,I:I").Select
Selection.NumberFormat = "[$ぎ-2] #,##0.00;[Red]-[$ぎ-2] #,##0.00"
Range("A1").Select
End If

Mike H

Macros Problem
 
Hi,

The snippet of code you posted doesn't convert column D so something else
must or it may already be converted.

Mike

"Gary" wrote:

Hi, I run the following macro to convert columns E,G,H,I into Euro's but it
keeps converting coulmn D, which I don't won't to convert. Can anyone help.
Thanks

If Range("D7") = "EURO" Then
Range("E:E,G:G,H:H,I:I").Select
Selection.NumberFormat = "[$ぎ-2] #,##0.00;[Red]-[$ぎ-2] #,##0.00"
Range("A1").Select
End If


Gary

Macros Problem
 
Thanks for the quick response, I just figured out what the problem is. Half
way down the sheet on one of the rows columns D & E had been merged, I
unmerged them and it works fine now.

"Mike H" wrote:

Hi,

The snippet of code you posted doesn't convert column D so something else
must or it may already be converted.

Mike

"Gary" wrote:

Hi, I run the following macro to convert columns E,G,H,I into Euro's but it
keeps converting coulmn D, which I don't won't to convert. Can anyone help.
Thanks

If Range("D7") = "EURO" Then
Range("E:E,G:G,H:H,I:I").Select
Selection.NumberFormat = "[$ぎ-2] #,##0.00;[Red]-[$ぎ-2] #,##0.00"
Range("A1").Select
End If


Don Guillett

Macros Problem
 
Good that you figured it out. You probably should remove selections also.

If Range("D7") = "EURO" Then
Range("E:E,G:G,H:H,I:I").NumberFormat = "[$ぎ-2] #,##0.00;[Red]-[$ぎ-2]
#,##0.00"
end if
End If

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Gary" wrote in message
...
Thanks for the quick response, I just figured out what the problem is.
Half
way down the sheet on one of the rows columns D & E had been merged, I
unmerged them and it works fine now.

"Mike H" wrote:

Hi,

The snippet of code you posted doesn't convert column D so something else
must or it may already be converted.

Mike

"Gary" wrote:

Hi, I run the following macro to convert columns E,G,H,I into Euro's
but it
keeps converting coulmn D, which I don't won't to convert. Can anyone
help.
Thanks

If Range("D7") = "EURO" Then
Range("E:E,G:G,H:H,I:I").Select
Selection.NumberFormat = "[$ぎ-2] #,##0.00;[Red]-[$ぎ-2] #,##0.00"
Range("A1").Select
End If




All times are GMT +1. The time now is 07:23 PM.

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