Search: | |||||

| ||||

Home » Forum » MS Office | RSS Feeds |

I am working on an Excel spreadsheet & I am stuck on a

problem. VBA is new to me but I think it will help me do what I

would like. Here is what I am trying to accomplish. I have a sheet

in a workbook titled Daily Readings in which I can enter numbers to

arrive at the daily totals of various things where I work. There is

an area for each day of the year on this sheet with each day having

45 rows of information. I am trying to copy daily totals onto

another sheet titled Generation which would list the daily total on

a month to month basis. I know I can cut & paste each individual

cell from the Daily Readings sheet to the Generation sheet but it is

so time consuming! What I am looking for is a way to copy every

45th cell in a column from the Daily Readings sheet starting at F9 &

paste them into the Generation sheet in consecutive order in column

C starting at C11. As I said VBA is new to me but with the help of

a few tutorials I have found I think I can figure out where the code

will have to be placed.

Something like this:

Sub blah()

y = 11 'destination row of first result

For x = 9 To 16500 Step 45 'source rows

'the 6 in the line below is the 6th column (F) and the 3 the 3rd(C)

Sheets("Daily Readings").Cells(x, 6).Copy Sheets("Generation").Cells

(y, 3)

y = y + 1

Next x

End Sub

The line beginning 'Sheets' may have been split by yahoo; the line

after it should be 'y = y + 1'

Here is what happened. I opened the

workbook & opened the Microsoft Visual Basic window (Alt + F11). In

the Project – VBAProject window on the left I added a module. In

this Module window, I entered the code as you had written. Under the

Run tab, I selected Run Sub/UserForm. I went back to the Generation

sheet & had entries in the C column but they were not correct.

I do not know if this affects it or not but this is what I think may

have affected the process. In the F column of the daily Readings

sheet is the following formula =IF(E9=0,0,E9-D9)*100 This takes the

present reading, subtracts the previous reading & multiplies it by a

constant giving me a daily total. If nothing is entered in the E9

cell it returns a 0. After entering the code, cell C11 on the

Generation sheet show 100. When I click on that cell I get the

following formula, =IF(B11=0,0,B11-A11)*100 It looks to me like it

is taking the day of the month from B11 seeing it is not equal to 0,

then taking B11 (First Day Of Month) – A11 (Blank) & multiplying

by

100. On day # 2 I show 200, each day increases by 100. Is it

because of the formula entered in the Daily Reading sheet I am

trying to copy from that I end up with this? Any suggestions which

may clear it up?

Didn't find what you were looking for?
Find more on Help with Cut & Paste
Or get search suggestion and latest updates.

Related Topics:

- Hyperlink on Canvas...Cut, Copy & Paste provison on Canvas
- macro recorder for cut and paste type activities
- macro recorder for cut and paste type activities
- help me how to get rid of daily copy paste job
- Excel Macro help - conditional copy and paste from one worksheet to another
- Help on copy and paste
- New to VBA and need help with copy and paste
- Macro help newbie: VB conditional if statement to copy paste cell
- Paste Formula help
- Help needed with Range Copy and Paste
- a problem with the CUT command
- How to enable cut & copy commands
- Newbie VBA Macro question- Conditional Copy & Paste based on time
- VBA Code for pasting a set of formulas down a data range
- If Cells Have a value, copy and paste into new worksheet
- copy/paste
- Activesheet.Paste method gives error
- Error message on Paste operation
- copy / paste problem
- problem in searching and pasting a find cell
- Looped VBA to paste special values
- Copy and paste between worksheet with total rows unknown
- Excel VBA - need to copy paste conditional statement
- pasting word table to Excel but needing to match excel
- Copy and Paste using VBA