Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'Put the sheet name in row 1 of the new sheet
ActiveSheet.Range("b3").Select
ActiveSheet.Cells(1, 2) = sSheetName
'Select the worksheet that the rows were selected from
'then define the rows selected by parsing the string that stores the address
'of the selected range
ActiveWorkbook.Sheets("formatted_data").Select
'Retrieve the selected range from excel
sRange = ActiveWindow.RangeSelection.Address
'This code locates the colon that seperates the range values
iColonLocate = InStr(1, sRange, ":", vbTextCompare)
'This code tells us the length of the entire string holding the range values
iStringLength = Len(sRange)
'Now we store the first row number after stripping out the dollar signs and the colon
sRowsFirst = Mid(sRange, 2, iColonLocate - 2)
'Store the last row number after stripping out the dollar signs and the colon
sRowsLast = Mid(sRange, iColonLocate + 2, iColonLocate + 2 + iStringLength)
'Loop through the rows placing the sheet name in column "A"
For R = sRowsFirst To sRowsLast
ActiveSheet.Cells(R, 1).Value = sSheetName
Next R
'Return to the new worksheet that we created
ActiveWorkbook.Sheets(sSheetName).Select