gauravkrgautam
Member
Hi team,
I have created a simple macro which is changing some integers into string from referenced column.
Coding for the same is
But when I tried to change my_simple_range into more dynamic_range there I am getting error please help me in same
New coding is
I want to update only activecell's column of current region
File is been attached with sample data. Please help me.
I have created a simple macro which is changing some integers into string from referenced column.
Coding for the same is
Code:
Sub integer_to_name()
Dim Int_rng As Range, name_rng As Range, cell As Variant
Set Int_rng = ActiveCell.CurrentRegion
MsgBox Int_rng.Address
Set name_rng = Sheet1.Range("n1:n" & Range("m65000").End(xlUp).Row)
For Each cell In Int_rng
cell.Value = name_rng.Cells(cell.Value, 1)
Next
End Sub
New coding is
Code:
Sub integer_to_name1()
Dim Int_rng As Range, name_rng As Range, cell As Variant
Set Int_rng = ActiveCell.CurrentRegion.Columns(ActiveCell.Column - ActiveCell.CurrentRegion.Column + 1)
MsgBox Int_rng.Address
Set name_rng = Sheet4.Range("M2:M" & Range("m65000").End(xlUp).Row)
For Each cell In Int_rng
cell.Value = name_rng.Cells(cell.Value, 1)
Next
End Sub
File is been attached with sample data. Please help me.