Code/VBA pls

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
543
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
We have the following sheet

Excel 2010 32 bit
[Table="width:, class:head"][tr=bgcolor:#E0E0F0][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][th]
E
[/th][th]
F
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
1
[/td][td]
1​
[/td][td]
224​
[/td][td]
205​
[/td][td]
218​
[/td][td]
230​
[/td][td]
218​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
2
[/td][td]
2​
[/td][td]
112​
[/td][td]
106​
[/td][td]
100​
[/td][td]
94​
[/td][td]
105​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
3
[/td][td]
3​
[/td][td]
51​
[/td][td]
58​
[/td][td]
59​
[/td][td]
46​
[/td][td]
49​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
4
[/td][td]
4​
[/td][td]
22​
[/td][td]
24​
[/td][td]
22​
[/td][td]
27​
[/td][td]
27​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
5
[/td][td]
5​
[/td][td]
11​
[/td][td]
12​
[/td][td]
12​
[/td][td]
12​
[/td][td]
9​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
6
[/td][td]
6​
[/td][td]
8​
[/td][td]
10​
[/td][td]
10​
[/td][td]
8​
[/td][td]
12​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
7
[/td][td]
7​
[/td][td]
2​
[/td][td]
2​
[/td][td]
2​
[/td][td]
0​
[/td][td]
1​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
8
[/td][td]
8​
[/td][td]
0​
[/td][td]
3​
[/td][td]
1​
[/td][td]
3​
[/td][td]
3​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
9
[/td][td]
9​
[/td][td]
1​
[/td][td]
[/td][td]
[/td][td]
1​
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
10
[/td][td]
10​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
2​
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
11
[/td][td]
11​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
12
[/td][td]
12​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
13
[/td][td]
13​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
14
[/td][td]
14​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
15
[/td][td]
15​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
16
[/td][td]
16​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]Sheet: Sheet1[/td][/tr][/table]

now we want to check the cells A1:F16, which coloumn was maximum entry (i mean which cell was filled more then others), after finding maximum filled cell it will remove the data from that cells in cell A

Result are
Excel 2010 32 bit
[Table="width:, class:head"][tr=bgcolor:#E0E0F0][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][th]
E
[/th][th]
F
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
1
[/td][td]
1​
[/td][td]
224​
[/td][td]
205​
[/td][td]
218​
[/td][td]
230​
[/td][td]
218​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
2
[/td][td]
2​
[/td][td]
112​
[/td][td]
106​
[/td][td]
100​
[/td][td]
94​
[/td][td]
105​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
3
[/td][td]
3​
[/td][td]
51​
[/td][td]
58​
[/td][td]
59​
[/td][td]
46​
[/td][td]
49​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
4
[/td][td]
4​
[/td][td]
22​
[/td][td]
24​
[/td][td]
22​
[/td][td]
27​
[/td][td]
27​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
5
[/td][td]
5​
[/td][td]
11​
[/td][td]
12​
[/td][td]
12​
[/td][td]
12​
[/td][td]
9​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
6
[/td][td]
6​
[/td][td]
8​
[/td][td]
10​
[/td][td]
10​
[/td][td]
8​
[/td][td]
12​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
7
[/td][td]
7​
[/td][td]
2​
[/td][td]
2​
[/td][td]
2​
[/td][td]
0​
[/td][td]
1​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
8
[/td][td]
8​
[/td][td]
0​
[/td][td]
3​
[/td][td]
1​
[/td][td]
3​
[/td][td]
3​
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
9
[/td][td]
9​
[/td][td]
1​
[/td][td]
[/td][td]
[/td][td]
1​
[/td][td]
[/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
10
[/td][td]
10​
[/td][td]
[/td][td]
[/td][td]
[/td][td]
2​
[/td][td]
[/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]Sheet: Sheet1[/td][/tr][/table]

help pls
 
i dont think so, when we run the code, nothing will work
"nothing will work" is not an informative reply. Can you answer the questions I posed in post#9?

Also, are you certain the last filled cell in Cols A:E is in col A? Could there be formula cells in cols B:E that are returning ""?
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
you are right, "nothing will work" is not an informative reply.

but i dont know why some times the code work or some time not,

we just need to remove the filled text from column A, as in B1:E36, last maximum filled data is B22

so all the data will be remove after row 22
 
Upvote 0
you are right, "nothing will work" is not an informative reply.

but i dont know why some times the code work or some time not,

we just need to remove the filled text from column A, as in B1:E36, last maximum filled data is B22

so all the data will be remove after row 22
Sorry, I can't see why the code won't work for you and you haven't answered some of the questions I asked which might help to diagnose the problem.
 
Upvote 0
Thanks for the notice on my query JoeMo Ji

we will try to sort out self and if not get the answer, ask here again

thanks for your help
 
Upvote 0
@Vishaal
I have rerun my code on your latest and it works as designed. If you are still having issues, then I suggest you upload a sample workbook to a third party site, ie. Dropbox.com or Box.net for example and let us analyze your issues for you.

Alan
 
Upvote 0
Thanks for the attention on my query alansidman Ji


thanks for your help and time......

i will share the sheet, if find the problem again and again
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top