We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.
Sub MyLookup()
Dim lRow As Long
lRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
With Sheets("Sheet1")
.Range("B2:B" & lRow) = Application.WorksheetFunction.VLookup(.Range("A2:A" & lRow), Sheets("Sheet2").Range("A:B"), 2, 0)
End With
End Sub
Example.xls
Sun ApplyNames()
Dim rngID As Range, rngLookup As Range
'assume Sheet1 holds the 500 IDs and blank name column
'assume Sheet2 range A2:B11 holds your unique IDs and the Names you want to apply to Sheet1
With Sheets("Sheet1")
Set rngID = .Range("A2:A" & .Cells(.Rows.Count,"A").End(xlUp).Row) 'assume header in row 1
End With
Set rngLookup = Sheets("Sheet2").Range("A2:B11") 'amend as appropriate
'now apply names using Vlookup function of the WorksheetFunction object:
rngID.Offset(0,1).Value = Application.Vlookup(rngID,rngLookup,2,False)
End Sub
Sub test1()
Dim n As Long
For n = 1 To Range("A1:AB5000").Count
Range("A1:AB5000").Cells(n).Value = 1
Next n
End Sub
Sub test2()
Range("A1:AB5000").Value = 1
End Sub
Sub test1()
Dim n As Long
With Sheets("Sheet1")
For n = 1 To 5000
.Cells(n, 1) = 1
Next n
End With
End Sub
Sub test1()
Dim n As Long
For n = 1 To Range("A1:AB1000").Count
Range("A1:AB1000").Cells(n) = "=5+2"
Next n
End Sub
Sub test2()
Range("A1:AB50000") = "=5+1"
End Sub
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
VBA Delete selected Worksheets of each Workbook in a Folder | 4 | 31 | |
Do Wend Macro not working | 22 | 36 | |
Conditional formatting of a cell based on text anywhere in the workbook | 4 | 65 | |
Using SUMPRODUCT with a Date Range | 6 | 21 |
Join the community of 500,000 technology professionals and ask your questions.