Help with Array formula not setting required cells to specified value for all selected sheets.

Kayslover

Board Regular
Joined
Sep 22, 2020
Messages
168
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

I have a macro that uses the following command and it works as expected:-

VBA Code:
Sheets(Array("Jan Income", "Feb Income", "Mar Income", "Apr Income", "May Income", "June Income", "July Income", "Aug Income", "Sept Income", "Oct Income", "Nov Income", "Dec Income")).Select

Range("B6:B7,F7,I6:BZ7").Select

Selection.ClearContents

I also require certain cells to be set to 0 and have therefore added the following after Selection.ClearContents in the above:-

VBA Code:
Range("F6,G6,E7,F7").Value = 0

However, the last command only sets the above cells in sheet called Jan Income to 0. The other sheets do not get populated.

Any assistance you can offer would be appreciated.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try replacing this line
VBA Code:
Range ("F6,G6,E7,F7").Value = 0
With this
VBA Code:
Range("F6,G6,E7,F7").Select
Selection.Value = 0
 
Upvote 0
Solution
igold,

Firstly, sorry for the delay in responding to your post. I have been out of town for a few days.

Secondly, Your recommendation worked a treat.

Lastly, I appreciate your kind assistance.
 
Upvote 0
No problem, I am glad it worked for you. Thanks for the feedback!
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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