Forum

Max Value Header Na...
 
Notifications
Clear all

Max Value Header Name And Value in vba

14 Posts
3 Users
0 Reactions
79 Views
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

i have required header name and corresponding data trough the vba
i am attached excel fie and describe my problem
thanks in advance

 
Posted : 31/01/2023 6:56 am
(@keebellah)
Posts: 373
Reputable Member
 

Goodday, please attach the file using the upload button.

 
Posted : 01/02/2023 3:32 am
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

sorry sir but i am already attached my file

 
Posted : 01/02/2023 6:17 am
(@keebellah)
Posts: 373
Reputable Member
 

Well, then there is something seriously wrong with your file it's unreadable
Screenshot-2023-02-01-081353.png

 
Posted : 02/02/2023 3:15 am
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

sorry sir I am new file attached........

 
Posted : 02/02/2023 5:47 am
(@keebellah)
Posts: 373
Reputable Member
 

Sorry, the file is not readable, no difference, I have no idea how or what you are doing.

 
Posted : 03/02/2023 3:00 am
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

sorry sir but
I don't know why the file is not uploading Properly so i am attached two images 1 is my data and second is my result
my problem is Project wise fM range max value which fm in data then sheet column header name to print in column A and corresponding data in B if max value is greter than five then print in next slot. Every FM No. start in 25 row gap.
I am created micro but is countinues row no 18 to data range. and my code is

Sub FindMaxVal()
Dim i As Integer, FindProj, FindMaxVal As Variant, RowNo As Long
FindProj = Application.Match(Sheets("Result").Range("G1").Value, Sheets("Data").Range("A:A"), 0)
FindMaxVal = WorksheetFunction.Max(Sheets("Data").Range("B" & FindProj & ":AE" & FindProj))
RowNo = 18
For i = 2 To 31
If Sheets("Data").Cells(FindProj, i).Value = FindMaxVal Then
Sheets("Result").Cells(RowNo, "I").Value = Sheets("Data").Cells(1, i).Value
Sheets("Result").Cells(RowNo, "J").Value = Sheets("Data").Cells(FindProj, i).Value
RowNo = RowNo + 1
End If
Next i
End Sub

this code is continuously given data.
I have every 5 solot in after first FM1 to FM5 is first slot and if data is data long then data is ever five slot to pace properly. Data-sheets.png

result-sheets.png

 
Posted : 03/02/2023 7:00 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

@Hans Hallebeek. You can right-click on the file (e.g. in post # 5) select "Save link as". It than allows you to save the file to a folder on your computer. I've had similar problem with txt and csv files uploaded to the Forum.

 
Posted : 03/02/2023 10:00 am
(@keebellah)
Posts: 373
Reputable Member
 

@Riny van Eekelen: I must confess I did not think of that option, the link mislead mme and it never happened with other files.
Thanks for the tip.
Hans

 
Posted : 04/02/2023 2:59 am
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

Pease help! me sir i am stuck in my project..........

 
Posted : 06/02/2023 1:33 am
(@keebellah)
Posts: 373
Reputable Member
 

Try this one, select a project name and then click the blue arrow on the left

 
Posted : 07/02/2023 4:08 am
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

thanks sir

i have only max value in a result sheet and corresponding fm Number not print in less no and NA and i am some row is hide my result slot is fixed.
Like Project A is max value is 6 then Fm no start fm1 to 17 but Project B is max value is only fm13, fm16, fm 21, fm28
Like that

my first slot start at row no 17 , second is row no 42 , third is 67, fourth is 92 and fifth is 117

thanks ones again for support to my problem..............................

 
Posted : 07/02/2023 5:30 am
(@keebellah)
Posts: 373
Reputable Member
 

I don’t understand what you want but maybe the macro can help you work it out, it’s quite simple to include exclusions and actions, you z’n Taylor it to your needs
A clear and concise explanation will get you answers you expect

 
Posted : 07/02/2023 9:08 am
(@khatikvasim13)
Posts: 24
Eminent Member
Topic starter
 

thank sir given to solution my query is finally solve.  

 
Posted : 08/02/2023 3:03 am
Share: