Range VBA Errors

Glasgowsmile

Active Member
Joined
Apr 14, 2018
Messages
280
Office Version
  1. 365
Platform
  1. Windows
I've got this range I'm trying to work with and do the following but I'm getting an error message for application or object-defined error. When I use the full range it seems to be the AB sections that are causing the problem. When I delete everything and just use the AB Range it works fine.

Should I even be listing it this way or is Dim as Range as better method?

Range
VBA Code:
G9:G10, G12, G14, G16, G18, G20, J9:J10, J12, J14, J16, J18, J20, M9:M10, M12, M14, M16, M18, M20, P9:P10, P12, P14, P16, P18, P20, S9:S10, S12, S14, S16, S18, S20, V9:V10, V12, V14, V16, V18, V20, Y9:Y10, Y12, Y14, Y16, Y18, Y20, AB9:AB10, AB12, AB14, AB16, AB18, AB20

Code for the Range
VBA Code:
Sheets(3).Range("").Font.Color = vbBlack
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
This works for me:

VBA Code:
Sheets(3).Range("G9:G10,G12,G14,G16,G18,G20,J9:J10,J12,J14,J16,J18,J20,M9:M10,M12,M14,M16,M18,M20,P9:P10,P12,P14,P16,P18,P20,S9:S10,S12,S14,S16,S18,S20,V9:V10,V12,V14,V16,V18,V20,Y9:Y10,Y12,Y14,Y16,Y18,Y20,AB9:AB10,AB12,AB14,AB16,AB18,AB20").Font.Color = vbBlack
 
Upvote 0

Forum statistics

Threads
1,215,888
Messages
6,127,590
Members
449,386
Latest member
owais87

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