Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
I can't understand why this code only works for the 1st 16 rows if I am NOT on the sheet, yet works fully when I am on the sheet. I need it to work off a command button that is on a userform and I can be on any sheet.
VBA Code:
Dim wb As Workbook: Set wb = ThisWorkbook
Dim ws As Worksheet
Set ws = wb.Sheets("PasteSheet")
ws.Range("B2:B" & Range("A" & Rows.Count).End(xlUp).Row).Formula = "=TRIM(MID(SUBSTITUTE(A2,""."",REPT("" "",999)),999,999))"
ws.Range("C2:C" & Range("B" & Rows.Count).End(xlUp).Row).Formula = "=(""https://www.Yahoo.com/""&SUBSTITUTE(B2, "" "", """")&""/"")"