Inverted Commas & Range References-vba

  • Hi,
    I'm trying to combine 2 variable column refs and 2 fixed numbers to select a range in VBA, but I can't get the correct syntax re the number of inverted commas.


    Code
    Range("" & strFrom & "4"":" & strTo & "7""").Select


    (strFrom and strTo are the column variables, already defined)


    I've tried every combination (except the right one!) for over an hour and just cannot get this to work.


    If someone can also explain the logic around the number/placement of inverted commas it would be much appreciated - since they're all straight, I'm never sure whether I'm closing a set or opening a new set.


    Many thanks,
    Dave

  • Re: Inverted Commas & Range References-vba


    Thanks Roy & filo65, - that works grand ... I thought I needed a whole forest of speech marks, but obviously that's where I was going wrong!!


    Regards,
    Dave

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!