reader6886
New Member
- Joined
- Sep 10, 2020
- Messages
- 25
- Office Version
- 2019
- Platform
- Windows
Hello all beginner here.
How do I change the following vb codes so that the macros can be used for sheets with dynamic ranges.
1 Dynamic autofill ( even though autofill was done with autofill dot ) macro reording produced the code with absolute range(G2:G799). How do i make it dynamic.So autofill on other file dont miss any cells or overshoot !
2.how do I edit the table range to make it dynamic . Even though using the ctrl+**** + right/ left arrow produced the absolute range($A$1:$F$799) like below.
3. what do I use instead of the following code/range(change G2:G1007) so that when used with files with more or less row/columns the formula does not produce unnecessary characters click here in rows with no hyperlinks .
thanks in advance for tips.
How do I change the following vb codes so that the macros can be used for sheets with dynamic ranges.
1 Dynamic autofill ( even though autofill was done with autofill dot ) macro reording produced the code with absolute range(G2:G799). How do i make it dynamic.So autofill on other file dont miss any cells or overshoot !
VBA Code:
Range("G2").Select
ActiveCell.FormulaR1C1 = "=LEFT(RC[-2],65)"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G799")
Range("G2:G799").Select
2.how do I edit the table range to make it dynamic . Even though using the ctrl+**** + right/ left arrow produced the absolute range($A$1:$F$799) like below.
VBA Code:
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$F$799"), , xlYes).name = _
"Table1"
Range("Table1[#All]").Select
3. what do I use instead of the following code/range(change G2:G1007) so that when used with files with more or less row/columns the formula does not produce unnecessary characters click here in rows with no hyperlinks .
VBA Code:
Range("G2").Select
ActiveCell.FormulaR1C1 = "=HYPERLINK(RC[-3],""click here"")"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G1007")
Range("G2:G1007").Select
thanks in advance for tips.