Macros Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Hi,

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

Mike
 
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 said:
Hi,

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

Mike

Gary said:
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
 
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
(e-mail address removed)
Gary said:
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 said:
Hi,

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

Mike

Gary said:
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
 
Back
Top