I have Excel Output, whose rows and columns are dynamic on weekly execution.
How to select the range ??
i want an VBA code
the value is started from B2 in every time
these is the code but ranges varies dynamically
I have Excel Output, whose rows and columns are dynamic on weekly execution.
How to select the range ??
i want an VBA code
these is the code but ranges varies dynamically
Can you try the below
NewFile.txt (551 Bytes)
or
If the value is started from B2 every time then try below
Cheers!!
tesst.xlsx (112.9 KB)
this is my sheet it cant perform the code
Sub SelectDynamicRange()
Dim lastRow As Long
Dim lastColumn As Long
Dim ws As Worksheet
' Set the worksheet reference
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your actual sheet name
' Find the last row and last column with data
lastRow = ws.Cells(ws.Rows.Count, "B").End(xlUp).Row
lastColumn = ws.Cells(2, ws.Columns.Count).End(xlToLeft).Column
' Select the range starting from B2 to the last row and last column
ws.Range("B2", ws.Cells(lastRow, lastColumn)).Select
End Sub
What is your required output
fill the blank cells with zero
Oh Thanks, Can You Share that Workflow
Thanks Bro its Working
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.