macros help

hail11

Board Regular
i am currently using this code

Dim x As Long
x = Worksheets("Sheet1").Range("O" & Rows.Count).End(xlUp).Row
If x = 1 And Worksheets("Sheet1").Range("J22") = "" Then x = 0
Worksheets("Sheet1").Range("O" & x + 1) = Range("J22")

however what i need is if a1 = jan then range J21 sheet 1
a1 = Feb then range K21 sheet 1
a1 = (throughout the rest of the months) moving range over by one

Excel Facts

Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Peter_SSs

MrExcel MVP, Moderator
however what i need is

if a1 = jan
Is A1 text "jan" (or "Feb", "Mar", etc) or an actual date?

then range J21 sheet 1
Where is the result to go?

Also, what sheet name is the Activesheet when the code is running?
I note that virtually all your range references are prefixed by a sheet name except
= Range("J22")
Does that indicate that this particular "J22" is not on Sheet1 but in the Activesheet?

hail11

Board Regular
everything will go off of sheet 1 in the same workbook

Question 1: I need to include my code i have because i need thouse numbers in other cells

Question 2:It is text

Question 3: If the a1 = jan then range J21 goes to AA1

Sorry about the confusin hope this helps

Peter_SSs

MrExcel MVP, Moderator
everything will go off of sheet 1 in the same workbook

Question 1: I need to include my code i have because i need thouse numbers in other cells

Question 2:It is text

Question 3: If the a1 = jan then range J21 goes to AA1

Sorry about the confusin hope this helps
Sorry, I still don't fully understand.

What goes where if A1 = Feb ?
What goes where if A1 = Mar ?

Hopefully from that I can get the pattern.

hail11

Board Regular
if a1 = jan then J Colum , if feb then K Colum, if march then L colum so on so all info will fall under the colum if it = that month

Peter_SSs

MrExcel MVP, Moderator
if a1 = jan then J Colum, if feb then K Colum, if march then L colum so on so all info will fall under the colum if it = that month
Does this mean that if A1 = Jan then the J21 value should be put in AA1?
and if A1 = Feb then the K21 value should be put in AA1 etc?

You have to be specific and detailed! Remember that you know what your sheet looks like and what you are trying to do, we don't have either of those luxuries.

Replies
4
Views
458
Replies
2
Views
101
Replies
1
Views
78
Replies
1
Views
153
Replies
3
Views
157

1,191,087
Messages
5,984,543
Members
439,896
Latest member
SquareCare

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.

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

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