Macros Problem

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
 
G

Guest

Hi,

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

Mike
 
G

Guest

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
 
D

Don Guillett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Workbook_Open in ThisWorkbook.module 1
AUTO_OPEN 2
I am trying to write a macro using If...Then 1
shorter macro 1
Automaticaly select range 1
Error in Macro 2003 2
Looping through columns 2
macro problem 2

Top