excel vba - loop using CStr to increment row -


i looping through file (junk data.xlsx) capture data (thisworkbook). range c1 direct reference data in junk data file , works great using cstr increment row number in junk data file. when use formula cell contents in junk data file strip off left 3 characters (=left(c1,3) range a1 syntax error message. wrong trying do?

dim r integer 'for row count in junk data file r = 1 workbooks("junk data.xlsx").sheets("sheet1").activate  'loop through junk data file until empty row found  while cells(r, 1) <> ""     thisworkbook.activate     range("a1").select     activecell.formular1c1 = "=left('[junk data.xlsx]sheet1'!r" & cstr(r) &"c1",3)"      range("c1").select     activecell.formular1c1 = "='[junk data.xlsx]sheet1'!r" & cstr(r) & "c8"      workbooks("junk data.xlsx").sheets("sheet1").activate     r = r + 1 loop 

 &"c1",3)" 

one quotation mark many:

 &"c1,3)" 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -