Capitalize the last character in column “K” conditionally.

harzer

Board Regular
Joined
Dec 15, 2021
Messages
153
Office Version
  1. 2016
Platform
  1. Windows
Hello everyone,
I present to you a very small part of my database, the latter is made up of 13 columns of: ("A:M")
I would like a code in vba please (using UBound, so that the code is fast) to capitalize only the last character of the cells of column "K", provided that the latter is equal to "x ".
Thank you for your propositions.

Classeur1
ABCDEFGHIJKLM
1JeunePèreMèreEleveurÂgeVolièreCageNé(e)ToursCouleurElevageConsanguinitéancêtre principale
2Ae27-054/2023 MAe27-010/2021 MMn96-034/2021 FLamback Léon0a 11m 3j5H5451094TMâle0,02011.56% through Mn96+-021/2019 M (1 path)
3Ae27-055/2023 FMn96-046/2019 MMn96-010/2021 FLamback Léon0a 10m 25j4B9451194TFemellex0,02011.56% through Mn96+-021/2019 M (1 path)
4Ae27-056/2023 FMn96-046/2019 MMn96-010/2021 FLamback Léon0a 10m 25j4B9451194TFemelle0,02011.56% through Mn96+-021/2019 M (1 path)
5Ae27-057/2023 FMn96-046/2019 MMn96-010/2021 FLamback Léon0a 10m 25j4B9451194TFemelle0,02011.56% through Mn96+-021/2019 M (1 path)
6Ae27-058/2023 FMn96-046/2019 MMn96-010/2021 FLamback Léon0a 10m 25j4B9451194TFemelle0,06181.88% through Ae27-032/2017 M (2 paths)1.67% × 1
72024-059/2023 MMn96-046/2019 MMn96-010/2021 FLamback Léon0a 10m 25j5H9451194TMâle0,06181.88% through Ae27-032/2017 M (2 paths)1.67% × 1
830247-060/2023 M3024-066/2020 M2207-032/2020 FLamback Léon1a 0m 13j5 milliards30450704TMâleX0,0211.56% through Mn96+-021/2019 M (1 path)
9Ae27-060/2023 FAe27-010/2021 MAe27-038/2022 FLamback Léon0a 10m 20j4B3451244TFemelle0,0211.56% through Mn96+-021/2019 M (1 path)
10Ae27-061/2023 FAe27-010/2021 MAe27-038/2022 FLamback Léon0a 10m 20j4B3451244TFemelle 0,0211.56% through Mn96+-021/2019 M (1 path)
11Ae27-062/2023 FAe27-010/2021 MAe27-038/2022 FLamback Léon0a 10m 20j4B3451244TFemelle 0-
12Ae27-063/2023 FAe27-010/2021 MAe27-038/2022 FLamback Léon0a 10m 20j4B3451244TFemelle X0-
13Ae27-064/2023 FAe27-010/2021 MAe27-038/2022 FLamback Léon0a 10m 20j4B3451244TFemelle 0-
14Ae27-065/2023 FAe27-021/2022 MAe27-020/2022 FLamback Léon0a 10m 20j4B8451244TFemellex0-
15Ae27-066/2023 MAe27-018/2022 MMn96-045/2022 FLamback Léon0a 10m 23j5H10451214TMâle0,09753.13% through Mn96-002/2020 M (1 path)
16Ae27-067/2023 MAe27-018/2022 MMn96-045/2022 FLamback Léon0a 10m 23j5H10451214TMâle0,09753.13% through Mn96-002/2020 M (1 path)
17Ae27-068/2023 FAe27-018/2022 MMn96-045/2022 FLamback Léon0a 10m 23j4B10451214TFemelle 0-
18Ae27-069/2023 MAe27-018/2022 MMn96-045/2022 FLamback Léon0a 10m 23j5H10451214TMâle X0-
19Ae27-070/2023 MAe27-022/2022 MAe27-031/2022 FLamback Léon0a 10m 20j5H6451244TMâle 0-
20Ae27-071/2023 FAe27-022/2022 MAe27-031/2022 FLamback Léon0a 10m 20j4B6451244TFemelle 0-
21Ae27-072/2023 MAe27-033/2022 MMn96-008/2022 FLamback Léon0a 10m 19j5H11451254TMâle0-
22Ae27-073/2023 MAe27-033/2022 MMn96-008/2022 FLamback Léon0a 10m 19j5H11451254TMâle0-
23Ae27-074/2023 FAe27-033/2022 MMn96-008/2022 FLamback Léon0a 10m 19j4B11451254TFemelle0-
24Ae27-001/2024 FAe27-010/2021 MAe27-017/2023 FLamback Léon0a 1m 13j5H12454064TFemelle Tte jauneElevé / Ae27-017/23 x0-
25Ae27-002/2024 MAe27-010/2021 MAe27-017/2023 FLamback Léon0a 1m 13j5H12454064TMâle Tt jauneElevé / Ae27-017/230-
26Ae27-003/2024 FAe27-036/2023 MMn96-045/2022 FLamback Léon0a 1m 9j5H13454104TFemelle Tte jauneElevé / Ae27-017/23X0,06623.36% through Mn96-045/2019 M (1 path)
27Ae27-004/2024 FAe27-036/2023 MMn96-045/2022 FLamback Léon0a 1m 9j5H13454104TFemelle Tâche aile droiteElevé / Ae27-017/230,06623.36% through Mn96-045/2019 M (1 path)
28Ae27-005/2024 MAe27-022/2023 MAe27-015/2023 FLamback Léon0a 1m 4j5H11454134TMâle Tte jauneElevé / Ae27-023/23 X0-
29Ae27-006/2024 MAe27-022/2023 MAe27-015/2023 FLamback Léon0a 1m 4j5H11454134TMâle Tâche derrière œil gaucheElevé / Ae27-023/230-
30Ae27-007/2024 M5919-001/2023 MAe27-023/2023 FLamback Léon0a 1m 4j5H8454134TMâle Tt jauneElevé / Ae27-023/23 X0-
31Ae27-008/2024 MAe27-033/2022 MAe27-009/2023 FLamback Léon0a 1m 4j5H4454134TMâle Tâche au dosElevé / Ae27-023/230-
32Ae27-009/2024 MAe27-033/2022 MAe27-009/2023 FLamback Léon0a 1m 4j5H4454134TMâle Tâche au dosElevé / Mn96-045/22x0-
33Ae27-010/2024 MAe27-033/2022 MAe27-009/2023 FLamback Léon0a 1m 4j5H4454134TMâle Tâche ronde à la têteElevé / Mn96-045/220-
34Ae27-011/2024 MAe27-035/2022 MAe27-055/2023 FLamback Léon0a 1m 2j5H16454154TMâle 0-
35Ae27-012/2024 MAe27-035/2022 MAe27-055/2023 FLamback Léon0a 1m 2j5H16454154TMâle 0-
36Ae27-013/2024 MAe27-035/2022 MAe27-055/2023 FLamback Léon0a 1m 2j5H16454154TMâle 0-
37Ae27-014/2024 MAe27-035/2022 MAe27-055/2023 FLamback Léon0a 1m 2j5H16454154TMâle 0-
38Ae27-015/2024 MAe27-035/2022 MAe27-055/2023 FLamback Léon0a 1m 2j5H16454154TMâle 0-
39Ae27-016/2024 MMn96-020/2023 MAe27-038/2022 FLamback Léon0a 0m 31j5H10454184TMâle 0-
40Ae27-017/2024 MMn96-020/2023 MAe27-038/2022 FLamback Léon0a 0m 31j5H10454184TMâle 0-
41Ae27-018/2024 MAe27-069/2023 MMn96-034/2021 FLamback Léon0a 0m 31j5H2454184TMâle Elevé / Ae27-026/220-
42Ae27-019/2024 MAe27-022/2022 MMn96-010/2021 FLamback Léon0a 0m 30j5H9454194TMâle 0,06623.36% through Mn96-045/2019 M (1 path)
43Ae27-020/2024 MAe27-022/2022 MMn96-010/2021 FLamback Léon0a 0m 30j5H9454194TMâle 0,06623.36% through Mn96-045/2019 M (1 path)
44Ae27-021/2024 MAe27-022/2022 MMn96-010/2021 FLamback Léon0a 0m 30j5H9454194TMâle x0,06623.36% through Mn96-045/2019 M (1 path)
Parents
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
VBA Code:
Sub harzer()
   With Range("K2", Range("K" & Rows.Count).End(xlUp))
      .Value = Evaluate(Replace("if(@="""","""",if(right(@)=""x"",left(@,len(@)-1)&""X"",@))", "@", .Address))
   End With
End Sub
 
Upvote 0
Solution
Hello Fluff,
Thanks for your proposition.
The code works very well and satisfies me.
THANKS.
Greetings.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,877
Messages
6,175,134
Members
452,614
Latest member
MRSWIN2709

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