Excel formatting issues

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
User avatar
Derek27
Posts: 23620
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

I'm using VBA to write bet instructions to the spreadsheet but it keeps changing the format, clears the green background, larger font and changes odds to currency!

Has anyone else had this problem or know what the cause is?
Capture.PNG
You do not have the required permissions to view the files attached to this post.
greenmark
Posts: 4983
Joined: Mon Jan 29, 2018 2:15 pm

Derek27 wrote:
Thu Oct 21, 2021 2:19 pm
I'm using VBA to write bet instructions to the spreadsheet but it keeps changing the format, clears the green background, larger font and changes odds to currency!

Has anyone else had this problem or know what the cause is?

Capture.PNG
Record macro.
Reformat the cells manually to your preference.
Save macro then examine it in VBA. Then you can see the required VBA syntax to reformat to include in your VBA instructions.
Or perhaps I've misunderstood. Which is quite likely. :-)
User avatar
Derek27
Posts: 23620
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

greenmark wrote:
Thu Oct 21, 2021 3:08 pm
Derek27 wrote:
Thu Oct 21, 2021 2:19 pm
I'm using VBA to write bet instructions to the spreadsheet but it keeps changing the format, clears the green background, larger font and changes odds to currency!

Has anyone else had this problem or know what the cause is?

Capture.PNG
Record macro.
Reformat the cells manually to your preference.
Save macro then examine it in VBA. Then you can see the required VBA syntax to reformat to include in your VBA instructions.
Or perhaps I've misunderstood. Which is quite likely. :-)
I know how to change cell formats in VBA but there wouldn't be much point if BA or something else is changing them. What I don't understand is that normally when you use Range("A1")=5 VBA simply places a 5 in cell A1 without changing font, backcolour or data type.
foxwood
Posts: 394
Joined: Mon Jul 23, 2012 2:54 pm

I use this and format not affected - various versions of Excel, latest being 365

Code: Select all

' 'i' is the selection number from top to bottom of BA master sheet
Worksheets("Bet Angel").Range("L" & (9 + (2 * i))).Value = "LAY"
Worksheets("Bet Angel").Range("M" & (9 + (2 * i))).Value = LayOdds

EDIT based on your latest comment think it could be you are not using ".Value" ?
User avatar
Derek27
Posts: 23620
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

Thanks greenmark and foxwood (I was going to say greenwood :lol: ) but I've just solved it.

I was using Range.Clear. Should have been Range.ClearContents. :D
User avatar
Derek27
Posts: 23620
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

I won't start a new thread but I notice the BA spreadsheet templates are in Excel 97-2003 format. Can you save them in an up-to-date format? Does it matter?
foxwood
Posts: 394
Joined: Mon Jul 23, 2012 2:54 pm

Derek27 wrote:
Thu Oct 21, 2021 8:16 pm
I won't start a new thread but I notice the BA spreadsheet templates are in Excel 97-2003 format. Can you save them in an up-to-date format? Does it matter?
I'm using latest Excel from Office 365 on server / desktops and main files I use are *.xslm (macro enabled) saved on a daily basis.

They all descend from the original BA templates years ago and have been saved from different versions of Excel with no problems at all.

Just make sure you have a back up of the file and watch it run to satisfy yourself there are no problems from saving/opening otherwise it could be a rant ;)
User avatar
Derek27
Posts: 23620
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

foxwood wrote:
Fri Oct 22, 2021 12:34 am
Derek27 wrote:
Thu Oct 21, 2021 8:16 pm
I won't start a new thread but I notice the BA spreadsheet templates are in Excel 97-2003 format. Can you save them in an up-to-date format? Does it matter?
I'm using latest Excel from Office 365 on server / desktops and main files I use are *.xslm (macro enabled) saved on a daily basis.

They all descend from the original BA templates years ago and have been saved from different versions of Excel with no problems at all.

Just make sure you have a back up of the file and watch it run to satisfy yourself there are no problems from saving/opening otherwise it could be a rant ;)
Cheers foxwood. I doubt it makes a difference performance-wise but I find it irritating having that 'compatibility mode' in the Excel title bar, making you feel you're out of date. :)
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”