Sumanth 01
New Member
- Joined
- Jun 17, 2020
- Messages
- 2
- Office Version
- 2019
- Platform
- Windows
Hi Team,
I have the need to format many different ranges of cells into similarly formatted tables, and I was hoping to write a macro to satisfy this repetitive task. The ranges already have data in them based on formulas linked to pivot tables. I tried to record a macro with the key strokes for the formatting that I require, but I was not able to completely get it right. I ran into 2 issues: (1) I couldn't figure out how to scale the macro (ie - apply the macro to the cell ranges that I didn't actually record the macro in) and (2) The macro did not record all of the formatting nuances that I require. I am a finance guy with very little understanding of coding and VBA, but this is what i would like my macro to do:
(1) Select all cells in a named range (ie - I would like to run this macro by either selecting the range myself and then using a "hot key" to perform the formatting or by selecting the top-left-most cell in the range and the macro recognizes the named range from there when I execute the "hot key" - if that is even possible)
(2) Creating the table with the range and a thick border around the range with Black Colour
(3) Fill the Header Row with a colour using RGB (i.e., Red : 169 , Green : 215 , Blue : 255).
(4) Add bold font to the headers and center headers within the cells
Any help with this would be very helpful. Thanks in advance for any responses.
I have the need to format many different ranges of cells into similarly formatted tables, and I was hoping to write a macro to satisfy this repetitive task. The ranges already have data in them based on formulas linked to pivot tables. I tried to record a macro with the key strokes for the formatting that I require, but I was not able to completely get it right. I ran into 2 issues: (1) I couldn't figure out how to scale the macro (ie - apply the macro to the cell ranges that I didn't actually record the macro in) and (2) The macro did not record all of the formatting nuances that I require. I am a finance guy with very little understanding of coding and VBA, but this is what i would like my macro to do:
(1) Select all cells in a named range (ie - I would like to run this macro by either selecting the range myself and then using a "hot key" to perform the formatting or by selecting the top-left-most cell in the range and the macro recognizes the named range from there when I execute the "hot key" - if that is even possible)
(2) Creating the table with the range and a thick border around the range with Black Colour
(3) Fill the Header Row with a colour using RGB (i.e., Red : 169 , Green : 215 , Blue : 255).
(4) Add bold font to the headers and center headers within the cells
Any help with this would be very helpful. Thanks in advance for any responses.