Listview in VBA - amouting is not pulling with format - excel

The amount is not pulling in listview with proper format. Eg: If I enter 1,00,000 then listview is showing as 100000. Can you please assist me
I just want to show the commas in my amount.

Listview controls only accept text. If you add something that's not text, it converts it however it sees fit. If you want to format a number or date to display a certain way, you have to format it yourself.
lvItem.ListSubItems.Add Format$(10^6,"#,###,##0")

Related

Changing date format when prepopulating text box

I am placing a variable date value into a VBA text box (to prepopulate it), but excel is converting the date format from Australian (dd/mm/yyyy) to US (mm/dd/yyyy). Note this question is primarily about unwanted changes to the date format displayed in the text box, not the unwanted format coming out of the text box (though that is also obviously a problem!).
I have checked that the value immediately prior to it being placed in the text box is in the desired format; but it is then converted and displayed in US format. When I retrieve the value from the text box and place it in a spreadsheet it is in the unwanted US format.
Please note that Cdate does not appear to fix this. I used Cdate on the string coming out of the text box but it is still US format when I place the result into a spreadsheet. I have also tried using Cdate on the string going into the text box but it is still US format.
Any suggestions on what's going on would be much appreciated!
To populate the textbox you could use Format Function, to force the date format displayed :
Textbox1.Text=Format(yourdate,"dd/mm/yyyy")
The default date format in your spreadsheet is linked to the regional settings of your computer but if you can specify what format is used by selecting it with Format Cells
However, i'm note sure how Excel can detect what date format is retrieved from the textbox. You might want to use a date picker instead of a textbox (Formatting MM/DD/YYYY dates in textbox in VBA)

Excel having a field day changing the appearance of dates

I have a mac - sigh. I am using excel on the mac.
All date fields have the type of "date", with a format of month/day/year (eg 3/14/2019)
If I enter the value as 10/13/2019, then all is well.
If I enter the value as 10/12/2019, then excel will store it as 10/12/2019, but display it as 12/10/2019
What I mean is that looking at the cells, you'll see 12/10/2019. However, if you click on the cell, then in the little text field at the top, the cell contents are displayed as "10/12/2019".
This is going to confuse the hell out of my american co-workers - it is already confusing me.
I can solve this by putting a ' in front of the 10/12/2019 date... but I'm not sure why Excel is doing its best to make such a mess of this. Is there some way to tell it to stop "auto correcting" things?

Change the font color in a field using lotus script or #command

Is there a way to change the font color and its background of a rich text field? The goal here is to get a type of color whenever a word is changed from a list.
For instance, I can have a table with two columns, where first column is related to a type of vehicle and the second it is related to type of combustible used. So, let's imagine that every time a vehicle uses gasoline, so its wording should be shown yellow text and the field background in black. On the other hand, if a vehicle uses electrical, its wording should be shown red and the field background in green...
I know that there is a command but I do not know how to use it for more than one value.
#Command([TextSetFontColor]; [Red])
Any help?
You can't change the font and color of the existing text in a rich text field with the Notes #formulas or #commands. There are some tricks you can do (e.g., multiple subforms containing the same field, with different backgrounds and fonts, and a computed subform formula, or maybe with multiple computed-for-display fields and hide-whens - but the text would not be editable that way) before the text is entered into the field. If you want to change the font of already-existing rich text, you'll probably need to use the Notes C or C++ APIs, the MIDAS Rich Text API from Genii software. I think the background will have to be done with computed subforms or hide-whens and computed-for-display fields (for non-editable rich text), no matter what.

Cell with background text that disappears when clicked

I want to create cells which instruct the user on what need to be filled in that cell in the background and when you click to enter a something, this text vanishes. You normally see this you order something online. For example: Question: Date of Birth, answer field: DD/MM/YYYY in grey text. When you click on DD/MM/YYYY it dissappears and you can answer.
I would like to do this without using VBA, since I have no experience using VBA. Is this possible?
I thought about using conditional formatting, but I think the text won't disappear when clicked only when someone types something in.
Anyone has any idea how I can achieve this?
Thanks a lot
So you can enter placeholder text like cell value and colour it grey.
Then you can use Conditional Formatting to turn it black if new text is different than placeholder.
This would be the result:
However if you wan to make sure that your input is correct I suggest using Data Validation.

Auto Grouping/Merging in Excel

I think the image attached describes better than I can in words the functionality I am trying to locate within excel.
Is there a way to auto group based on the contents within the columns as shown? This is achievable for the example shown, but when there are up to say 30 Groups and many sub group types, I am wondering whether excel can auto-detect and work its way through the list, grouping as shown as it goes.
You can get a similar result using conditional formatting. select the whole table and create a new conditional format rule and choose formula and enter =A1=A2 set the format font to white (I've used very light grey to show that the data is still there)
To get the borders, do the same again and this time enter the formula =A1<>A2 and make the top border black.
It's not exactly the same as yours but it's close.

Resources