header.Offset(x, y).Address causing an error

VonRobbo

New Member
Joined
Mar 12, 2018
Messages
5
Hi guys, I'll keep this simple.

The setup:

HTML:
Dim header As Range

ThisWorkbook.Sheets("Category 1 Tasks").Select
Set header = Cells(Rows.Count, 1).End(xlUp).Offset(47, 0)
'adding the title
header.Select
Selection.Font.Bold = True
With Selection

This works fine:

HTML:
.Value = "=""3.2.""&(RIGHT(" & header.Offset(3, 3).Address & ",3))&"" ""&" & header.Offset(3, 3).Address

This gives me a syntax error:

HTML:
.Value = "=""3.2.""&(RIGHT(" & header.Offset(3, 3).Address & ",3))&"" ""&" & header.Offset(3, 3).Address &"" ""&" & header.Offset(4, 3).Address

All I'm trying to do is add some more text to the string that is at header


Regards,
Paul
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Welcome to the forum.

You missed a needed quote and an ampersand:

Rich (BB code):
.Value = "=""3.2.""&(RIGHT(" & header.Offset(3, 3).Address & ",3))&"" ""&" & header.Offset(3, 3).Address & "&"" ""&" & header.Offset(4, 3).Address
 
Upvote 0
Welcome to the forum.

You missed a needed quote and an ampersand:

Rich (BB code):
.Value = "=""3.2.""&(RIGHT(" & header.Offset(3, 3).Address & ",3))&"" ""&" & header.Offset(3, 3).Address & "&"" ""&" & header.Offset(4, 3).Address

Perfect, Thanks. I was getting confused with all the quoates and ampersands.
 
Upvote 0
It's happening again.

I'm trying to update series values in a chart based on offset references.

Code:
ActiveChart.FullSeriesCollection(1).Values = "=" & header.Offset(1, 32).Address

I'm getting run-time error 1004, even though the header.offset is returning the value I want it to.
 
Upvote 0
You should have a sheet name in there too.
 
Upvote 0
You should have a sheet name in there too.

Thanks for your help so far Rory.

I think it doesn't like that there are now double quotes and single quotes as I'm still getting an error.

Code:
ActiveChart.FullSeriesCollection(1).Values = "='Category 1 Tasks'" & header.Offset(1, 32).Address
 
Upvote 0
You’re missing an exclamation mark:

Code:
ActiveChart.FullSeriesCollection(1).Values = "='Category 1 Tasks'!" & header.Offset(1, 32).Address
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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