![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 7
|
I wanna be able to select some cells, and then execute some operation regarding each cell in the selection for example set each cell content uppercase. I manage to write a code for setting any activecell content as uppercase, but fail to do it for a selection.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try the following code by putting it in the code for your worksheet:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$F$4:$G$4" Then Target.Value = UCase(Target.Text) End If End Sub Subsitute "$F$4:$G$4" with your range, formatted the same way.
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
You can use a for each statement, like
Dim Cll as Range For each Cll in Selection 'do my stuff with the Cell "Cll" Next Cll |
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 7
|
Thanx Juan Pablo,
It helped me for 100%. I'am not professional in programming, so I ve been searching for this facility for several months. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|