Add data to dynamic range

gaudrco

Board Regular
Joined
Aug 16, 2019
Messages
203
I have a dynamic range that expands when I add new data(naturally). I would like to add code to a button that I have that will adddata to the range when the button is pressed. This is the line of code I amworking with:

Code:
[FONT="Calibri"]Sheets("Competitor OverviewData").Range("CompetitorsLOV").Offset(1, 0).Value =Range("C2").Value[/FONT]


My expectation for the code is that when the button ispressed, the text from cell “C2” will be added to the bottom of my dynamicrange called “CompetitorsLOV” which is located on sheet Competitor OverviewData.

Thanks!





 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try this:

Code:
With Sheets("CompetitorsLOV").Range("CompetitorsLOV")
.Offset(.Rows.Count).Resize(1) = Range("C2").Value
End With
 
Upvote 0
Thank you that worked. I had to fix the sheet name because you had it the same as the range name but other than that, perfect :)
 
Upvote 0
Ah, sorry for the wrong sheet name.
You're welcome, I'm glad to help, & thank you for the feedback.:)
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,122
Members
452,545
Latest member
boybenqn

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