Getting rid of the $ signs in VBA

Dolemitefunk

New Member
Joined
Oct 12, 2010
Messages
47
Hello again everyone, I was wondering if there was a way to unlock the Cells and Columns in VBA. So in otherwords, if I link a cell to another workbook, it automatically has $'s around the cel (eg $C$31), is there code in VBA to remove those signs? I have tried the record function, but it did not help. Thanks Again to all of you that are keeping us frustrated folks sane.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
... So in otherwords, if I link a cell to another workbook, it automatically has $'s around the cel (eg $C$31), is there code in VBA to remove those signs?

Hi

How are you doint this? Please post the code you are using to do this.
 
Upvote 0
Can't you just delete them yourself?

If you are using the macro recorder then you need to understand it isn't going to produce the exact code you need.

It's inevitable that you'll need to eke some changes.

Use it to get the general syntax that you need, not the complete code.:)
 
Upvote 0
Perhaps a bit of prevention:
After selecting the cell/range in the external workbook
and before pressing enter...
Each time you press the [F4] key the reference will cycle through
the absolute/relative options.

Example:
When the formula bar initially displays:
='[MyOther Workbook]Mysheet'!$A$1
Press [F4]...formula becomes: ='[MyOther Workbook]Mysheet'!A$1
Press [F4]...formula becomes: ='[MyOther Workbook]Mysheet'!$A1
Press [F4]...formula becomes: ='[MyOther Workbook]Mysheet'!A1
Press [F4]...formula becomes: ='[MyOther Workbook]Mysheet'!$A$1

Does that help?
 
Upvote 0
Sub Testing2()
Dim master As Workbook
Dim factors As Worksheet

Set master = ActiveWorkbook
Set factors = master.ActiveSheet

Set Large= Workbooks.Open("U:\ME\Quantity.xls")

Set Numbers= Large.Worksheets("Color BK")
Numbers.Select
Range("H14").Select
ActiveCell.FormulaR1C1 = "='[Comic Tables.xlsm]Sheet1'!R31C6"
Range("H14").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
 
Upvote 0
My apologies for the confusion...
I was thinking you wouldn't need to use VBA to correct the references
after-the-fact if you could easily create relative references just by
pressing [F4] when creating them.
 
Upvote 0
Eh, am I missing something here?

The reference you mention isn't in that code.:eek:

Are you actually referring to the R1C1 reference in the code?

If you are,I replace FormulaR1C1 with Formula and replace the reference with the equivalent A1 reference.
 
Last edited:
Upvote 0
Eh, am I missing something here?

The reference you mention isn't in that code.:eek:

Are you actually referring to the R1C1 reference in the code?

If you are,I replace FormulaR1C1 with Formula and replace the reference with the equivalent A1 reference.


So ActiveCell.Formula = "='[Comic Tables.xlsm]Sheet1'!R31C6"?
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top