Macro help needed !

  • Thread starter Thread starter GDuffield
  • Start date Start date
G

GDuffield

Please can someone help me !

I'm trying to use a macro to set the values in a column to those i
another column.

This 'should' be easy enough, but it has to populate the first blan
column it comes to !

i.e.

Col A has my sales for this week.

Columns B to ZZ has all the weeks for the year.... and I need it t
scoot along the columns, checking for the first empty one, then drop i
my values !

Dont know how to say

'if this column is empty drop in the values from ..... else try th
next column' ????

PLEASE HELP ! THANK
 
Try out this routine and see if this is what you are
looking for . . . make sure when you run it, your have
selected the cell, or even just the same row, with the
sales you wish to be "dropped into" the next blank column.

Sub Next_Empty_Week()
Dim iCol As Integer
For iCol = 2 To 256
If IsEmpty(Cells(ActiveCell.Row, iCol)) Then
Cells(ActiveCell.Row, iCol).Value = Cells
(ActiveCell.Row, 1).Value
Exit Sub
End If
Next iCol
End Sub
 
Back
Top