Excel VBA - Simple Code Problem

  • Thread starter Thread starter ajlove20
  • Start date Start date
A

ajlove20

Hi,

I am writing a macro uses an array to read in column A. Then it check
each array to see if there is a value in it. If there is a value i
it, it checks the rest of the rows (which goes to column S) for empt
cells. If there are empty cells, a inputbox should appear and ask fo
a value and place it into the empty cell. I am new to macros, so
have been using Selected Case statements to do this. Everything work
fine until I try to place a value into the empty cell. My inputbo
comes up, but when I put the value in it, nothing happens. Can someon
tell me what I may be doing wrong. My codes sort of looks like this:

Dim j As Integer
Dim z As Variant
Dim v As Variant
Dim i As Variant
On Error Resume Next

z = Range("A7:A27").Value
For j = 1 To 21
'MsgBox z(j, 1)
Next j
...

Select Case z(2, 1)
Case Is = ""
Case Else
v = Range("A8:S8").Value
For i = 0 To 19
MsgBox v(1, i)
Select Case v(1, i)
Case Is = ""
v(1, i) = InputBox("Enter Value")
End Select
Next i
...

Thanks in advance.

a
 
Hi
if I understood this correctly in the code below you only put the value
into an array. Did not see a cell entry?
 
Oh ok. How would I put the value into the cell that corresponds wit
value that should go into the array
 
Back
Top