LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default (Hopefully) Simple Array Pasting question.

Hello MVP's

An initial Caveat, I know almost nothing about VBA

I have, laboriously, created this code to check validation in my workbook
and highlight any cells in certain ranges that conflict with the allowed
validation.

I want to do this as i have an automated routine that pastes values into
these ranges from my CRM software, which can override the validation rules
set for manual entry - this is fine as I just then need users to update a few
conflicts.

So far I have this

Sub SetInvalidCellsRedAndStore()
Dim CACompiler(540) As String
Dim SheetCompiler(540) As String
ArrayCell = 0
For Each Sheet In Sheets
Sheet.Activate
Calculate
For Each Cell In Range("D10:E29")
ArrayCell = ArrayCell + 1
If Cell.Validation.Value = False Then
Cell.Interior.ColorIndex = 3
Cell.Font.Bold = True
CACompiler(ArrayCell) = Cell.Address
SheetCompiler(ArrayCell) = Sheet.Name
Else:
End If
Next Cell
Next Sheet
End Sub

Which at the end gives me two arrays each 540 items long with values in if
the corresponding cell matched the criteria i.e. failed validation checks.
all the other entries will be blank, that is not ideal, but OK.

All I want to do now is paste the contents of those two arrays into another
sheet.

I want the values of "SheetCompiler" to go into a sheet called "Datastore"
in the range A2:A541

And similarly, the values of "CACompiler" to go into the same sheet,
"Datastore" in the range B2:B541

But I can't even get close to getting it right despite having looked up
about 20 examples. I couldn't figure out how to customise them to my
requirements.

Any help with this is most appreciated.

Regards,
KeLee

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Simple copying and pasting macro Henrik Excel Programming 1 January 13th 05 11:35 PM
Simple Array question Chip Pearson Excel Programming 1 August 13th 03 01:08 AM
Simple Array question John Thomas Excel Programming 0 August 12th 03 11:14 PM


All times are GMT +1. The time now is 08:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"