ActiveWorkbook

cccbzg

Board Regular
Joined
Oct 5, 2014
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm wondering how I can change this line of code to make my field (CsaveDAYS) contain both the value AND the format from my range ("D" & i).

Thanks in advance for your help!

Bonnie

CsaveDAYS = ActiveWorkbook.Sheets("Summary Sheet").Range("D" & i).Value
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
What is you ultimate goal with this?
That is, what are you going to do with that cell's value and its formatting?
 
Upvote 0
What is you ultimate goal with this?
That is, what are you going to do with that cell's value and its formatting?

Im going to output the value with format into a cell in another sheet eventually, but I need to hold onto it until I get to a certain record type. So, I’ve got header type records and detail records on my input sheet and only detail records which need header data on my output sheet.

Hope me that makes sense.

Thanks so much.

Bonnie
 
Upvote 0
So, if you don't yet know where you are going to put it, set it to a Range variable
Code:
Dim rng as Range
Set rng = ActiveWorkbook.Sheets("Summary Sheet").Range("D" & i)

Then, when you have worked out where to put it (say in the same workbook, sheet "abc", cell K5)
Code:
rng.Copy Destination:= ActiveWorkbook.Sheets("abc").Range("K5")
 
Upvote 0
So, if you don't yet know where you are going to put it, set it to a Range variable
Code:
Dim rng as Range
Set rng = ActiveWorkbook.Sheets("Summary Sheet").Range("D" & i)

Then, when you have worked out where to put it (say in the same workbook, sheet "abc", cell K5)
Code:
rng.Copy Destination:= ActiveWorkbook.Sheets("abc").Range("K5")


Thanks! Will try later today and let you know how it goes.

I appreciate your your time and willingness to share expertise.

Bonnie
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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