# Visual Basic > Visual Basic .NET >  Excel formula in Visual Basic problem

## MrPumper

I have been using this formula


```
oSheet.Range("G" & m) = "=G" & n & " - G4"
```

It works, but now I want to change the order and subtract the variable cell from a static cell.
This is what I tried but it does not work.


```
oSheet.Range("G" & m) = "= G4 - G" & n""
```

It does not work, can you help?
Having trouble grasping where to put the ".

----------


## MrPumper

I believe I have it thanks to paul from an earlier post of mine.
Not sure what the $ and {} do. but it gives me the correct answer.


```
oSheet.Range($"G{m}") = $"= G4 - G{n}"
```

----------


## .paul.

The $ part denotes String interpolation
The variable enclosed in {} denotes its a variable to be inserted in the string

----------


## .paul.

The string interpolation gives the same result as



```
oSheet.Range("G" & m) = "= G4 - G" & n
```

----------


## .paul.

> The string interpolation gives the same result as
> 
> 
> 
> ```
> oSheet.Range("G" & m) = "= G4 - G" & n
> ```


This method is called concatenation. The literal parts are enclosed in   and the variables are added with &

----------


## MrPumper

Thanks .paul.

----------


## Cristianlt23

@.paul.

nice to see your sites.

As I'm a beginner in VB.NET I needed a lot!

Thanks!

----------


## .paul.

> @.paul.
> 
> nice to see your sites.
> 
> As I'm a beginner in VB.NET I needed a lot!
> 
> Thanks!


 :Thumb:

----------

