Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am trying to make an array of usernames which are located on Sheet2. And then trying to fill empty cells with those usernames in Sheet3 in a range of cells: A1 to I9. Below is my code. But seems like I am not understanding how to use activecell and so Excel doesn't like it giving an error saying "Object doesn't support this property or method". Appreciate for a help in advance! Thanks, DD Private Sub CommandButton1_Click() Dim oldnames As Range Dim newnames As Range Dim x As Integer Dim n As Integer Dim i As String Dim k As Integer Set newnames = Worksheets("Sheet2").Range("A1:A4") n = 1 For Each cell In Worksheets("Sheet3").Range("A1:I9") If IsEmpty(ActiveCell) Then Worksheets("Sheet3").ActiveCell = newnames(n) If (n <= 2) Then n = n + 1 Else n = 1 End If End If Next cell UserForm1.Hide End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Randomly populating empty cells with other text cells | Excel Discussion (Misc queries) | |||
Populating empty cells | Excel Worksheet Functions | |||
populating a cell will a value from a range of cells | Excel Programming | |||
populating a cell will a value from a range of cells | Excel Programming | |||
populating a cell will a value from a range of cells | Excel Programming |