Traditional Culture Encyclopedia - Almanac inquiry - Vba code about the color change of the whole line of excel.
Vba code about the color change of the whole line of excel.
As shown below, this is the effect under normal circumstances. When we select a cell, only the border color of the cell has changed, while the other cells in the row have not changed.
Now, what we need to do is, as shown in the figure below, once a cell is selected, the color of the row where the cell is located will change, which is convenient for us to input data.
To do this, right-click the worksheet name (for example, Sheet 1) and select View Code in the shortcut menu that pops up, as shown below!
Next, VBA coding window will pop up, as shown below!
five
In the above figure, right-click Sheet 1 and select View Code to open the code writing window.
Now, all we have to do is input VBA function code, as shown above! Remember, first select the name of the worksheet object and the name of the SelectionChange event, and then enter the code on the right side of the window as shown above.
For your convenience, please paste the following source code:
Private worksheet _ selection change (byval target as range)
rows()interior . colorindex = 0。
x = ActiveCell。 row
rows(x)。 interior。 colorindex = 9
End joint
- Previous article:[auspicious day] 201911019 Gregorian calendar query
- Next article:In 2023, the 18 boys' horoscope of the lunar winter moon.
- Related articles
- August 8, 2020 lunar calendar
- Can anyone borrow money in the first month?
- Perpetual calendar query February 8, 2007 Gregorian calendar
- Lixian history and culture
- A harbinger of the dream of eating hot pot
- The date corresponding to the solar term vernal equinox is
- Genuine yellow calendar in 2020
- 202 1 women born in the year of the ox, do you want to pick up a car in the animal year?
- 20211February 18 how about the wedding day? How about moving on 20211February 18?
- Zodiac auspicious day 2065438+April 30, 2008 Gregorian calendar query