Hi the forum,
Since yesterday, I try to solve a problem that combines technical VBA knowledge and programming logic.
Context (see attachment)
On a spreadsheet, I have 5 information: Prod, Position, Name, ID and Team.
The total number of lines, the number of vendors and the number of lines by...
Hi P45cal,
Thank you for the answer.
I would never consider using a MOD function to choose a color.
This solution meets my wish perfectly.
Congratulations for this original suggestion.
Have a nice day
Harry
Hi Narayan,
I suggest you open the uploaded file "test nuancier" and read the first sheet RMF (read me first).
You will understand I cannot give you a specific RGB value as it changes on each selection.
Hope this will help.
Thanks for your patience
Have a nice day
Harry
Hi Narayan,
Thanks for your answer.
The context is very simple.
The procedure reads, in a worksheet, the three RGB values and applies them as forecolor in a shape.
The name of the color (also coming from the worksheet) is written in the shape.
I try to find a logical reasoning which decides...
In a VBA procedure, I’m working with shapes.
As you can see in the code below, each shape has a colored background
With objshp
.Select
.TextFrame.Characters.Text = Cells(my_row, 3).Value
.Fill.ForeColor.RGB = RGB(col_red, col_green, col_blue)
End With
And some text is written in the...
Hello the forum,
Hi Deepak Narayan,
First of all, my apologies for this late reply.
Thank you to both of you for your response.
@Deepak
The first solution generates a compiler error
The second solution is good but more explicit in the Narayan’s code
The third solution works properly...
Hello forum,
I want to manipulate image files by transferring them to another folder and changing the name. See the code used.
The problem is that on the instruction "ModifiedDate_MyFile MyFile.DateLastModified =" VBA responds with a message "Invalid Procedure".
Could a member of the forum...
Hi Narayan,
Thanks for your quick answer.
Some more details
I'm working as volunteer for a public library and I realize some little Office developments.
1. What are the working hours exactly ?
The desk is open from 8 am till 6 pm. To keep it simple, as the employees are working 7 hours/day...
Hi the forum,
I need your help to solve in VBA a problem that bothers me for some time.
The problem concerns the planning of 4 employees (named from 1 to 4).
Between 02 jan 2014 and 31 dec 2014, for each working day, while one employee begins at 8 am, another stays till 6 pm. The other two...
Hi the forum,
A variable is defined as Static in a main procedure. To use it in another procedure, I put the name as a parameter between the parentheses after the name of the procedure in both the call and the sub.
But when I try to use the static variable in a event procedure, VBA gives an...
Hi Narayan,
Thanks for your answer.
After converting the Exif value with the substitute function, the cell contains a non numeric fraction value, for example "1/50". An in-depth analyze reveals the presence of an hidden (even in the formula bar) "?" character. Sole the len(cell) function with...
Hi Debraj, Narayan
@Debraj
I adapted your suggestion in VBA; is working fine except the "+0". It forces a mathematical operation on a text value which leads to an error.
See here my code, with myvalue containing the string to analyze; for example "?1/50 sec."
myvalue =...
hi the forum,
Let me present a problem to your sagacity.
In a spreadsheet, I display some Exif attributes of my picture files
The exposure time is expressed as a fraction of a second, eg 1/30 sec, 1/100 sec.
After eliminating the "sec" abbreviation, a fractional expression 1/30 or 1/100 remains...
Hallo Debraj,
In the referenced link I found the solution on my syntax problem.
Just add .adress for the variable ColToSort.
I saw also that you where learning french. So I conclude this thread with
Grand merci pour la réponse pertinente.
Have a nice day
Harry
Hello the forum,
I need help to solve a problem of syntax in the SORT function in VBA.
I want to sort the contents of a spreadsheet based on a criterion selected from a dropdown list. The sequence of items in the list corresponds to the sequence of column headings.
So I set the column to sort by...
Hello Narayan,
Thank you for the answer.
I tried a lookalike code but without success.
In fact an inappropriate instruction "Application.EnableEvents = False" prevented activate the event.
The problem is solved.
Have a nice day
Harry.
Hi the forum,
Should some people know the VBA instruction(s) to disable the close red cross on the top right of the title bar and force the user to close the file with a button in a worksheet?
Thanks in advance
Harry
Hello Sam Mathai Chacko,
thanks for the reference. In fact I didn't know that a global delaration existed for procedure. I use usually a Public declaration.
Hello Shrivallabha,
Thanks for your answer.
I tested the code as proposed.
After adding a I as integer, everything is OK and the...
Hi Narayan,
I found the rub.
In the workbook_open procedure I create at each run some command buttons.
I found by chance: http://support.microsoft.com/kb/231089
and I concluded that adding a button will force the sheet to go in design mode and that is the reason why the variables created after...
Hi Narayan,
Some explanation describing the context.
In workbook_open I populate the public array variable arrmsg; (wksh is the worksheet containing the text in the 27th column). I remember that the variable is declared in a separated module.
Sub workbook_open()
…………………some code………………………...
Hi Serene,
As I don't know anything of the context, I show you an application schema to put in a module.
Sub testrand()
Dim a As Single
a = Rnd * 1000 'to replace by your PIN calculator.
Call checkrnd(a)
End Sub
Function checkrnd(a)
If Int(a) < 600 Then Call testrand 'I show what you should do...
Hi Narayan
Apologies,
I fear that my last question was poorly worded.
To explain the public array variable becomes empty in other procedures, there is certainly a reason to VBA act so. That is what I try to understand.
Regards
Harry