Getting the Value from A Merged Cell

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Consider this range of cells in my worksheet
WS 24-May-22.xlsx
AB
1344705003<10:45A
1444705006
1544705034
1644697036
CRP


And this line of code:
Code:
grmtime = wb_data.Worksheets(grmcrew).Cells(rwcrewrid, 1).Offset(0, 1)

grmcrew = "CRP"
rwcrewid = 14

I am looking to get a value of grmtime = "<10:45A"

Because B13:B16 is merged, is this why in testing, the value of grmtime I'm getting is empty? I was hoping that the cell offset by 1 column would be the value of the merged cell.
Thoughts for improvement?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I advise you not to use merged cells. Especially when you are using VBA. They cause errors and mistakes.
First rule when you start with VBA;)

I acutally thought that you were trying to get rid of merged cells in your previous question
 
Upvote 0
Yes ... first rule. The worksheet with these merged cells is primarily a printed form, so the merging of vertical cells is necessary for the functionality of the printed form. It wasn't designed as a data source, but for my project, it does provide the data I'm looking for. Unfortunately, it's in a merged cell.

Maybe I can temporarily unmerge and populate as per you solution provided earlier.
 
Upvote 0
You could try:

Code:
wb_data.Worksheets(grmcrew).Cells(rwcrewrid, 1).Offset(0, 1).Mergearea(1).Value
 
Upvote 0
Solution
High five Rory! Thank you. So far it seems to have been the solution.
 
Upvote 0

Forum statistics

Threads
1,215,165
Messages
6,123,391
Members
449,098
Latest member
ArturS75

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